commit
0fd8cd9f70
1 changed files with 7 additions and 13 deletions
|
@ -62,14 +62,14 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
|
||||||
@Override
|
@Override
|
||||||
public ItemStack decrStackSize(int slot, int amount) {
|
public ItemStack decrStackSize(int slot, int amount) {
|
||||||
ItemStack item = this.crafting.decrStackSize(slot, amount);
|
ItemStack item = this.crafting.decrStackSize(slot, amount);
|
||||||
this.onInventoryChanged();
|
super.onInventoryChanged();
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setInventorySlotContents(int slot, ItemStack stack) {
|
public void setInventorySlotContents(int slot, ItemStack stack) {
|
||||||
this.crafting.setInventorySlotContents(slot, stack);
|
this.crafting.setInventorySlotContents(slot, stack);
|
||||||
this.onInventoryChanged();
|
super.onInventoryChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -100,7 +100,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
|
||||||
for (int slot = 0; slot < this.getSizeInventory(); slot++){
|
for (int slot = 0; slot < this.getSizeInventory(); slot++){
|
||||||
ItemStack item = this.getStackInSlot(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();
|
required[slot] = item.copy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -154,21 +154,15 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
|
||||||
ItemStack item = inventory.getStackInSlot(slot);
|
ItemStack item = inventory.getStackInSlot(slot);
|
||||||
|
|
||||||
if (item != null){
|
if (item != null){
|
||||||
boolean refilAll = false;
|
|
||||||
|
|
||||||
for (int slot1 = 0; slot1 < this.getSizeInventory(); slot1++){
|
for (int slot1 = 0; slot1 < this.getSizeInventory(); slot1++){
|
||||||
ItemStack item1 = this.getStackInSlot(slot1);
|
ItemStack item1 = this.getStackInSlot(slot1);
|
||||||
if (item1 != null && item1.stackSize == 1 && item.isItemEqual(item1)){
|
if (item1 != null && item1.stackSize == 1 && item.isItemEqual(item1)){
|
||||||
item1.stackSize++;
|
item1.stackSize++;
|
||||||
inventory.decrStackSize(slot, 1);
|
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();
|
this.refilFromNeibour();
|
||||||
|
|
||||||
if (!this.canCraft()){
|
if (!this.canCraft()){
|
||||||
return new ItemStack[0];
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.craft();
|
this.craft();
|
||||||
item = result.copy();
|
item = result.copy();
|
||||||
}else{
|
}else{
|
||||||
return new ItemStack[0];
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ItemStack[] { item };
|
return new ItemStack[] { item };
|
||||||
|
|
Loading…
Reference in a new issue