Some more work on the farm

This commit is contained in:
modmuss50 2015-07-13 16:24:50 +01:00
parent c160abf176
commit ef5d81d8e2
2 changed files with 154 additions and 6 deletions

View file

@ -1,17 +1,21 @@
package techreborn.tiles;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import techreborn.api.farm.IFarmLogicContainer;
import techreborn.api.farm.IFarmLogicDevice;
import techreborn.farm.FarmTree;
import techreborn.util.Inventory;
public class TileFarm extends TileMachineBase {
public class TileFarm extends TileMachineBase implements IInventory {
public Inventory inventory= new Inventory(14, "TileFarm", 64);
public Inventory inventory = new Inventory(14, "TileFarm", 64);
IFarmLogicDevice logicDevice;
public int size = 4;
public TileFarm() {
}
@ -41,5 +45,66 @@ public class TileFarm extends TileMachineBase {
logicDevice.tick(this);
}
super.updateEntity();
inventory.hasChanged = false;
}
@Override
public int getSizeInventory() {
return inventory.getSizeInventory();
}
@Override
public ItemStack getStackInSlot(int slot) {
return inventory.getStackInSlot(slot);
}
@Override
public ItemStack decrStackSize(int slot, int amount) {
return inventory.decrStackSize(slot, amount);
}
@Override
public ItemStack getStackInSlotOnClosing(int slot) {
return inventory.getStackInSlotOnClosing(slot);
}
@Override
public void setInventorySlotContents(int slot, ItemStack stack) {
inventory.setInventorySlotContents(slot, stack);
}
@Override
public String getInventoryName() {
return inventory.getInventoryName();
}
@Override
public boolean hasCustomInventoryName() {
return inventory.hasCustomInventoryName();
}
@Override
public int getInventoryStackLimit() {
return inventory.getInventoryStackLimit();
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
return inventory.isUseableByPlayer(player);
}
@Override
public void openInventory() {
inventory.openInventory();
}
@Override
public void closeInventory() {
inventory.closeInventory();
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
}
}