Added Alloysmelter

This commit is contained in:
Gig 2015-04-24 15:01:19 +01:00
parent 4ac26ac086
commit 4c5477d816
7 changed files with 326 additions and 2 deletions

View file

@ -2,12 +2,14 @@ package techreborn.client;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import techreborn.client.container.ContainerAlloySmelter;
import techreborn.client.container.ContainerBlastFurnace;
import techreborn.client.container.ContainerCentrifuge;
import techreborn.client.container.ContainerQuantumChest;
import techreborn.client.container.ContainerQuantumTank;
import techreborn.client.container.ContainerRollingMachine;
import techreborn.client.container.ContainerThermalGenerator;
import techreborn.client.gui.GuiAlloySmelter;
import techreborn.client.gui.GuiBlastFurnace;
import techreborn.client.gui.GuiCentrifuge;
import techreborn.client.gui.GuiQuantumChest;
@ -15,6 +17,7 @@ import techreborn.client.gui.GuiQuantumTank;
import techreborn.client.gui.GuiRollingMachine;
import techreborn.client.gui.GuiThermalGenerator;
import techreborn.pda.GuiPda;
import techreborn.tiles.TileAlloySmelter;
import techreborn.tiles.TileBlastFurnace;
import techreborn.tiles.TileCentrifuge;
import techreborn.tiles.TileQuantumChest;
@ -31,7 +34,8 @@ public class GuiHandler implements IGuiHandler {
public static final int centrifugeID = 3;
public static final int rollingMachineID = 4;
public static final int blastFurnaceID = 5;
public static final int pdaID = 6;
public static final int alloySmelterID = 6;
public static final int pdaID = 7;
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world,
@ -61,6 +65,10 @@ public class GuiHandler implements IGuiHandler {
{
return new ContainerBlastFurnace(
(TileBlastFurnace) world.getTileEntity(x, y, z), player);
} else if (ID == alloySmelterID)
{
return new ContainerAlloySmelter(
(TileAlloySmelter) world.getTileEntity(x, y, z), player);
} else if (ID == pdaID)
{
return null;
@ -97,6 +105,10 @@ public class GuiHandler implements IGuiHandler {
{
return new GuiBlastFurnace(player,
(TileBlastFurnace) world.getTileEntity(x, y, z));
} else if (ID == alloySmelterID)
{
return new GuiAlloySmelter(player,
(TileAlloySmelter) world.getTileEntity(x, y, z));
} else if (ID == pdaID)
{
return new GuiPda(player);

View file

@ -0,0 +1,54 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import techreborn.tiles.TileAlloySmelter;
import techreborn.tiles.TileBlastFurnace;
public class ContainerAlloySmelter extends TechRebornContainer {
EntityPlayer player;
TileAlloySmelter tile;
@Override
public boolean canInteractWith(EntityPlayer player)
{
return true;
}
public int tickTime;
public ContainerAlloySmelter(TileAlloySmelter tileAlloysmelter,
EntityPlayer player)
{
tile = tileAlloysmelter;
this.player = player;
// input
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 0, 56, 25));
this.addSlotToContainer(new Slot(tileAlloysmelter.inventory, 1, 56, 43));
// outputs
this.addSlotToContainer(new SlotOutput(tileAlloysmelter.inventory, 2,
116, 35));
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
this.addSlotToContainer(new Slot(player.inventory, j + i * 9
+ 9, 8 + j * 18, 84 + i * 18));
}
}
for (i = 0; i < 9; ++i)
{
this.addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18,
142));
}
}
}

View file

@ -0,0 +1,46 @@
package techreborn.client.gui;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import techreborn.client.container.ContainerAlloySmelter;
import techreborn.client.container.ContainerBlastFurnace;
import techreborn.tiles.TileAlloySmelter;
import techreborn.tiles.TileBlastFurnace;
public class GuiAlloySmelter extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation(
"techreborn", "textures/gui/industrial_blast_furnace.png");
TileAlloySmelter alloysmelter;
public GuiAlloySmelter(EntityPlayer player,
TileAlloySmelter tilealloysmelter)
{
super(new ContainerAlloySmelter(tilealloysmelter, player));
this.xSize = 176;
this.ySize = 167;
alloysmelter = tilealloysmelter;
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
int p_146976_2_, int p_146976_3_)
{
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_)
{
this.fontRendererObj.drawString("Alloysmelter", 60, 6, 4210752);
this.fontRendererObj.drawString(
I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
}
}