mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
Make only the coffee machine and coal generator return their container item
Closes #426
This commit is contained in:
parent
7c0c366e43
commit
cfd6506eb3
3 changed files with 12 additions and 4 deletions
|
@ -80,7 +80,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
|
|||
this.maxBurnTime = burnTime;
|
||||
this.currentBurnTime = burnTime;
|
||||
|
||||
this.slots.set(0, StackUtil.addStackSize(this.slots.get(0), -1));
|
||||
this.slots.set(0, StackUtil.addStackSize(this.slots.get(0), -1, true));
|
||||
}
|
||||
|
||||
if(flag != this.currentBurnTime > 0 || this.lastCompare != this.getComparatorStrength()){
|
||||
|
|
|
@ -157,7 +157,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
|||
CoffeeIngredient ingredient = ItemCoffee.getIngredientFromStack(this.slots.get(i));
|
||||
if(ingredient != null){
|
||||
if(ingredient.effect(output)){
|
||||
this.slots.set(i, StackUtil.addStackSize(this.slots.get(i), -1));
|
||||
this.slots.set(i, StackUtil.addStackSize(this.slots.get(i), -1, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,8 +51,12 @@ public final class StackUtil{
|
|||
}
|
||||
|
||||
public static ItemStack setStackSize(ItemStack stack, int size){
|
||||
return setStackSize(stack, size, false);
|
||||
}
|
||||
|
||||
public static ItemStack setStackSize(ItemStack stack, int size, boolean containerOnEmpty){
|
||||
if(size <= 0){
|
||||
if(isValid(stack)){
|
||||
if(isValid(stack) && containerOnEmpty){
|
||||
return stack.getItem().getContainerItem(stack);
|
||||
}
|
||||
else{
|
||||
|
@ -64,7 +68,11 @@ public final class StackUtil{
|
|||
}
|
||||
|
||||
public static ItemStack addStackSize(ItemStack stack, int size){
|
||||
return setStackSize(stack, getStackSize(stack)+size);
|
||||
return addStackSize(stack, size, false);
|
||||
}
|
||||
|
||||
public static ItemStack addStackSize(ItemStack stack, int size, boolean containerOnEmpty){
|
||||
return setStackSize(stack, getStackSize(stack)+size, containerOnEmpty);
|
||||
}
|
||||
|
||||
public static boolean isIInvEmpty(NonNullList<ItemStack> slots){
|
||||
|
|
Loading…
Reference in a new issue