More stream work

This commit is contained in:
Cricket committed 2014-12-22 17:52:31 -05:00
1 parent 8f0f2d3937
commit 7c14f2db03
7 files changed
+35 -30

No files matched your search

@@ -92,11 +92,11 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
}
if(isFaster){
if(!worldObj.isRemote && worldObj.getWorldTime() % 10 == 0){
if(!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0){
doTransaction();
}
} else {
if(!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0){
if(!worldObj.isRemote && worldObj.getWorldTime() % 40 == 0){
doTransaction();
}
}
@@ -105,7 +105,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
}
private void doTransaction(){
if(!(isSlotNull(BASE) && !(isSlotNull(TARGET)))){
if(inventory[BASE] != null && inventory[TARGET] != null){
if(inventory[BASE].getItem() instanceof ItemBlock && inventory[TARGET].getItem() instanceof ItemBlock){
Block base = Block.getBlockFromItem(inventory[BASE].getItem());
Block target = Block.getBlockFromItem(inventory[TARGET].getItem());
@@ -116,13 +116,13 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
if(baseCarvable.carverHelper.variations.contains(target)){
if(isStackMode){
if(inventory[BASE].stackSize == inventory[BASE].getMaxStackSize()){
if(isSlotNull(OUTPUT)){
if(inventory[OUTPUT] == null){
inventory[OUTPUT] = inventory[BASE];
inventory[BASE] = null;
}
}
} else {
if(isSlotNull(OUTPUT)){
if(inventory[OUTPUT] == null){
inventory[OUTPUT] = new ItemStack(base, 1, inventory[BASE].getItemDamage());
inventory[BASE].stackSize--;
} else if(inventory[BASE].stackSize != 0){
@@ -137,13 +137,13 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
if(targetCarvable.carverHelper.variations.contains(base)){
if(isStackMode){
if(inventory[BASE].stackSize == inventory[BASE].getMaxStackSize()){
if(isSlotNull(OUTPUT)){
if(inventory[OUTPUT] == null){
inventory[OUTPUT] = inventory[BASE];
inventory[BASE] = null;
}
}
} else {
if(isSlotNull(OUTPUT)){
if(inventory[OUTPUT] == null){
inventory[OUTPUT] = new ItemStack(base, 1, inventory[BASE].getItemDamage());
inventory[BASE].stackSize--;
} else if(inventory[BASE].stackSize != 0){
@@ -157,14 +157,6 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
}
}
private boolean isSlotNull(int slot){
if(inventory[slot] == null){
return true;
} else {
return false;
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);