Added gui/container to alloy furnace
This commit is contained in:
parent
88bb4db40f
commit
e784681b56
6 changed files with 240 additions and 0 deletions
|
@ -3,6 +3,7 @@ package techreborn.client;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.client.container.ContainerAesu;
|
||||
import techreborn.client.container.ContainerAlloyFurnace;
|
||||
import techreborn.client.container.ContainerAlloySmelter;
|
||||
import techreborn.client.container.ContainerAssemblingMachine;
|
||||
import techreborn.client.container.ContainerBlastFurnace;
|
||||
|
@ -20,6 +21,7 @@ import techreborn.client.container.ContainerQuantumTank;
|
|||
import techreborn.client.container.ContainerRollingMachine;
|
||||
import techreborn.client.container.ContainerThermalGenerator;
|
||||
import techreborn.client.gui.GuiAesu;
|
||||
import techreborn.client.gui.GuiAlloyFurnace;
|
||||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.client.gui.GuiAssemblingMachine;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
|
@ -38,6 +40,7 @@ import techreborn.client.gui.GuiRollingMachine;
|
|||
import techreborn.client.gui.GuiThermalGenerator;
|
||||
import techreborn.pda.GuiPda;
|
||||
import techreborn.tiles.TileAesu;
|
||||
import techreborn.tiles.TileAlloyFurnace;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
import techreborn.tiles.TileAssemblingMachine;
|
||||
import techreborn.tiles.TileBlastFurnace;
|
||||
|
@ -76,6 +79,7 @@ public class GuiHandler implements IGuiHandler {
|
|||
public static final int dieselGeneratorID = 15;
|
||||
public static final int industrialElectrolyzerID = 16;
|
||||
public static final int aesuID =17;
|
||||
public static final int alloyFurnaceID = 18;
|
||||
|
||||
|
||||
|
||||
|
@ -151,6 +155,10 @@ public class GuiHandler implements IGuiHandler {
|
|||
{
|
||||
return new ContainerAesu(
|
||||
(TileAesu) world.getTileEntity(x, y, z), player);
|
||||
} else if (ID == alloyFurnaceID)
|
||||
{
|
||||
return new ContainerAlloyFurnace(
|
||||
(TileAlloyFurnace) world.getTileEntity(x, y, z), player);
|
||||
} else if (ID == pdaID)
|
||||
{
|
||||
return null;
|
||||
|
@ -231,6 +239,10 @@ public class GuiHandler implements IGuiHandler {
|
|||
{
|
||||
return new GuiAesu(player,
|
||||
(TileAesu) world.getTileEntity(x, y, z));
|
||||
} else if (ID == alloyFurnaceID)
|
||||
{
|
||||
return new GuiAlloyFurnace(player,
|
||||
(TileAlloyFurnace) world.getTileEntity(x, y, z));
|
||||
} else if (ID == pdaID)
|
||||
{
|
||||
return new GuiPda(player);
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.inventory.SlotFurnace;
|
||||
import techreborn.client.SlotOutput;
|
||||
import techreborn.tiles.TileAlloyFurnace;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
import techreborn.tiles.TileBlastFurnace;
|
||||
|
||||
public class ContainerAlloyFurnace extends TechRebornContainer {
|
||||
|
||||
EntityPlayer player;
|
||||
|
||||
TileAlloyFurnace tile;
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public int tickTime;
|
||||
|
||||
public ContainerAlloyFurnace(TileAlloyFurnace tileAlloyfurnace,
|
||||
EntityPlayer player)
|
||||
{
|
||||
tile = tileAlloyfurnace;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 0, 47, 17));
|
||||
this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 1, 65, 17));
|
||||
// outputs
|
||||
this.addSlotToContainer(new SlotOutput(tileAlloyfurnace.inventory, 2, 116, 35));
|
||||
// Fuel
|
||||
this.addSlotToContainer(new Slot(tileAlloyfurnace.inventory, 3, 56, 53));
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
61
src/main/java/techreborn/client/gui/GuiAlloyFurnace.java
Normal file
61
src/main/java/techreborn/client/gui/GuiAlloyFurnace.java
Normal file
|
@ -0,0 +1,61 @@
|
|||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
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 net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.client.container.ContainerAlloyFurnace;
|
||||
import techreborn.client.container.ContainerAlloySmelter;
|
||||
import techreborn.client.container.ContainerBlastFurnace;
|
||||
import techreborn.tiles.TileAlloyFurnace;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
import techreborn.tiles.TileBlastFurnace;
|
||||
|
||||
public class GuiAlloyFurnace extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/alloy_furnace.png");
|
||||
|
||||
TileAlloyFurnace alloyfurnace;
|
||||
|
||||
public GuiAlloyFurnace(EntityPlayer player,
|
||||
TileAlloyFurnace tileAlloyFurnace)
|
||||
{
|
||||
super(new ContainerAlloyFurnace(tileAlloyFurnace, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
alloyfurnace = tileAlloyFurnace;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
|
||||
this.buttonList.clear();
|
||||
int k = (this.width - this.xSize) / 2;
|
||||
int l = (this.height - this.ySize) / 2;
|
||||
this.buttonList.add(new GuiButton(0, k + 4, l + 4, 20, 20, "R"));
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@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(StatCollector.translateToLocal("tile.techreborn.alloyfurnace.name"), 40, 6, 4210752);
|
||||
this.fontRendererObj.drawString(
|
||||
I18n.format("container.inventory", new Object[0]), 8,
|
||||
this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue