Merge pull request #793 from Need4Speed402/patch-1

some fix
This commit is contained in:
CovertJaguar 2013-04-27 16:57:32 -07:00
commit 0fd8cd9f70

View file

@ -62,14 +62,14 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
@Override
public ItemStack decrStackSize(int slot, int amount) {
ItemStack item = this.crafting.decrStackSize(slot, amount);
this.onInventoryChanged();
super.onInventoryChanged();
return item;
}
@Override
public void setInventorySlotContents(int slot, ItemStack stack) {
this.crafting.setInventorySlotContents(slot, stack);
this.onInventoryChanged();
super.onInventoryChanged();
}
@Override
@ -100,7 +100,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
for (int slot = 0; slot < this.getSizeInventory(); slot++){
ItemStack item = this.getStackInSlot(slot);
if (item != null && item.stackSize == 1){
if (item != null && item.stackSize == 1 && !item.getItem().hasContainerItem()){
required[slot] = item.copy();
}
}
@ -154,21 +154,15 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
ItemStack item = inventory.getStackInSlot(slot);
if (item != null){
boolean refilAll = false;
for (int slot1 = 0; slot1 < this.getSizeInventory(); slot1++){
ItemStack item1 = this.getStackInSlot(slot1);
if (item1 != null && item1.stackSize == 1 && item.isItemEqual(item1)){
item1.stackSize++;
inventory.decrStackSize(slot, 1);
if (slot1 == this.getSizeInventory() - 1) refilAll = true;
}else{
refilAll = false;
}
if (this.canCraft()) return;
}
if (refilAll) return;
}
}
}
@ -253,14 +247,14 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
this.refilFromNeibour();
if (!this.canCraft()){
return new ItemStack[0];
return null;
}
}
this.craft();
item = result.copy();
}else{
return new ItemStack[0];
return null;
}
return new ItemStack[] { item };