Some improvements to render speed of cables

This commit is contained in:
modmuss50 2015-06-25 20:10:03 +01:00
parent 7c56cd25f6
commit 37467cab7e
5 changed files with 21 additions and 19 deletions

View file

@ -39,12 +39,14 @@ public class ModPartItem extends Item {
try {
if(modPart instanceof CablePart){
if (ModPartRegistry.masterProvider.placePart(item, player, world, x, y, z, face, x_, y_, z_, modPart.getClass().getDeclaredConstructor(int.class).newInstance(((CablePart) modPart).type))) {
player.swingItem();
return true;
}
}else{
if (ModPartRegistry.masterProvider.placePart(item, player,
world, x, y, z, face, x_, y_, z_, modPart.getClass()
.newInstance())) {
player.swingItem();
return true;
}
}
@ -64,7 +66,8 @@ public class ModPartItem extends Item {
if(modPart instanceof CablePart){
try {
if (partProvider.placePart(item, player, world, x, y, z, face, x_, y_, z_, modPart.getClass().getDeclaredConstructor(int.class).newInstance(((CablePart) modPart).type))) {
return true;
player.swingItem();
return true;
}
} catch (InvocationTargetException e) {
e.printStackTrace();
@ -73,7 +76,8 @@ public class ModPartItem extends Item {
}
} else {
if (partProvider.placePart(item, player, world, x, y, z, face, x_, y_, z_, modPart.getClass().newInstance())) {
return true;
player.swingItem();
return true;
}
}