2015-05-10 20:00:58 +02:00
|
|
|
package techreborn.tiles;
|
|
|
|
|
|
|
|
import ic2.api.tile.IWrenchable;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2015-06-07 10:38:12 +02:00
|
|
|
import net.minecraft.inventory.IInventory;
|
2015-05-10 20:00:58 +02:00
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
import techreborn.init.ModBlocks;
|
|
|
|
import techreborn.util.Inventory;
|
|
|
|
|
2015-06-07 10:38:12 +02:00
|
|
|
public class TileAlloyFurnace extends TileMachineBase implements IWrenchable , IInventory{
|
2015-05-10 20:00:58 +02:00
|
|
|
|
|
|
|
public int tickTime;
|
|
|
|
public Inventory inventory = new Inventory(4, "TileAlloyFurnace", 64);
|
|
|
|
|
|
|
|
public TileAlloyFurnace()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void updateEntity()
|
|
|
|
{
|
|
|
|
super.updateEntity();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public short getFacing()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setFacing(short facing)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean wrenchCanRemove(EntityPlayer entityPlayer)
|
|
|
|
{
|
|
|
|
if (entityPlayer.isSneaking())
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public float getWrenchDropRate()
|
|
|
|
{
|
|
|
|
return 1.0F;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
|
|
|
|
{
|
|
|
|
return new ItemStack(ModBlocks.AlloyFurnace, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isComplete()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void readFromNBT(NBTTagCompound tagCompound)
|
|
|
|
{
|
|
|
|
super.readFromNBT(tagCompound);
|
|
|
|
inventory.readFromNBT(tagCompound);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void writeToNBT(NBTTagCompound tagCompound)
|
|
|
|
{
|
|
|
|
super.writeToNBT(tagCompound);
|
|
|
|
inventory.writeToNBT(tagCompound);
|
|
|
|
|
|
|
|
}
|
2015-06-07 10:38:12 +02:00
|
|
|
|
|
|
|
@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);
|
|
|
|
}
|
2015-05-10 20:00:58 +02:00
|
|
|
}
|