Started work on the Blast furnace
This commit is contained in:
parent
1238f2d5a6
commit
72ec08f069
2 changed files with 154 additions and 6 deletions
|
@ -26,11 +26,11 @@ public class ContainerBlastFurnace extends TechRebornContainer {
|
|||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 0, 56, 25));
|
||||
this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 1, 56, 43));
|
||||
this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 0, 56, 25));//Input 1
|
||||
this.addSlotToContainer(new Slot(tileblastfurnace.inventory, 1, 56, 43));//Input 2
|
||||
// outputs
|
||||
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 2,
|
||||
116, 35));
|
||||
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 2, 116, 35));//Output 1
|
||||
this.addSlotToContainer(new SlotOutput(tileblastfurnace.inventory, 3, 116, 53));//Output 2
|
||||
|
||||
int i;
|
||||
|
||||
|
|
|
@ -3,20 +3,38 @@ package techreborn.tiles;
|
|||
import ic2.api.energy.prefab.BasicSink;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import techreborn.api.CentrifugeRecipie;
|
||||
import techreborn.api.TechRebornAPI;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.client.SlotOutput;
|
||||
import techreborn.client.container.TechRebornContainer;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Location;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileBlastFurnace extends TileMachineBase implements IWrenchable {
|
||||
public class TileBlastFurnace extends TileMachineBase implements IWrenchable, IInventory {
|
||||
|
||||
public int tickTime;
|
||||
public BasicSink energy;
|
||||
public Inventory inventory = new Inventory(3, "TileBlastFurnace", 64);
|
||||
public Inventory inventory = new Inventory(4, "TileBlastFurnace", 64);
|
||||
|
||||
public TileBlastFurnace()
|
||||
{
|
||||
//TODO configs
|
||||
energy = new BasicSink(this, ConfigTechReborn.CentrifugeCharge,
|
||||
ConfigTechReborn.CentrifugeTier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
|
||||
|
@ -73,4 +91,134 @@ public class TileBlastFurnace extends TileMachineBase implements IWrenchable {
|
|||
}
|
||||
|
||||
|
||||
public void update(){
|
||||
super.updateEntity();
|
||||
if(getStackInSlot(0) != null && getStackInSlot(1) != null){
|
||||
//TODO recipe stuffs
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return inventory.getSizeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int p_70301_1_)
|
||||
{
|
||||
return inventory.getStackInSlot(p_70301_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_)
|
||||
{
|
||||
return inventory.decrStackSize(p_70298_1_, p_70298_2_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int p_70304_1_)
|
||||
{
|
||||
return inventory.getStackInSlotOnClosing(p_70304_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_)
|
||||
{
|
||||
inventory.setInventorySlotContents(p_70299_1_, p_70299_2_);
|
||||
}
|
||||
|
||||
@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 p_70300_1_)
|
||||
{
|
||||
return inventory.isUseableByPlayer(p_70300_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
{
|
||||
inventory.openInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory()
|
||||
{
|
||||
inventory.closeInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_)
|
||||
{
|
||||
return inventory.isItemValidForSlot(p_94041_1_, p_94041_2_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate()
|
||||
{
|
||||
energy.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
{
|
||||
energy.onChunkUnload();
|
||||
}
|
||||
|
||||
public Packet getDescriptionPacket()
|
||||
{
|
||||
NBTTagCompound nbtTag = new NBTTagCompound();
|
||||
writeToNBT(nbtTag);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord,
|
||||
this.zCoord, 1, nbtTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net,
|
||||
S35PacketUpdateTileEntity packet)
|
||||
{
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord, yCoord, zCoord, xCoord,
|
||||
yCoord, zCoord);
|
||||
readFromNBT(packet.func_148857_g());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.readFromNBT(tagCompound);
|
||||
inventory.readFromNBT(tagCompound);
|
||||
tickTime = tagCompound.getInteger("tickTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
super.writeToNBT(tagCompound);
|
||||
inventory.writeToNBT(tagCompound);
|
||||
writeUpdateToNBT(tagCompound);
|
||||
}
|
||||
|
||||
public void writeUpdateToNBT(NBTTagCompound tagCompound)
|
||||
{
|
||||
tagCompound.setInteger("tickTime", tickTime);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue