Made compost only accept the current recipe's amount of items

This commit is contained in:
Ellpeck 2016-06-03 22:16:23 +02:00
parent dbf5a86560
commit 7749e9f67d

View file

@ -90,6 +90,17 @@ public class TileEntityCompost extends TileEntityInventoryBase{
this.sendUpdate();
}
@Override
public int getInventoryStackLimit(){
if(this.slots[0] != null){
CompostRecipe recipe = getRecipeForInput(this.slots[0]);
if(recipe != null && recipe.input != null){
return recipe.input.stackSize;
}
}
return super.getInventoryStackLimit();
}
@Override
public boolean canInsertItem(int slot, ItemStack stack, EnumFacing side){
return this.isItemValidForSlot(slot, stack);