Basic work on Aesu
This commit is contained in:
parent
e3bd172b96
commit
3d92772004
7 changed files with 226 additions and 1 deletions
src/main/java/techreborn/client
|
@ -2,6 +2,7 @@ package techreborn.client;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.client.container.ContainerAesu;
|
||||
import techreborn.client.container.ContainerAlloySmelter;
|
||||
import techreborn.client.container.ContainerAssemblingMachine;
|
||||
import techreborn.client.container.ContainerBlastFurnace;
|
||||
|
@ -18,6 +19,7 @@ import techreborn.client.container.ContainerQuantumChest;
|
|||
import techreborn.client.container.ContainerQuantumTank;
|
||||
import techreborn.client.container.ContainerRollingMachine;
|
||||
import techreborn.client.container.ContainerThermalGenerator;
|
||||
import techreborn.client.gui.GuiAesu;
|
||||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.client.gui.GuiAssemblingMachine;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
|
@ -35,6 +37,7 @@ import techreborn.client.gui.GuiQuantumTank;
|
|||
import techreborn.client.gui.GuiRollingMachine;
|
||||
import techreborn.client.gui.GuiThermalGenerator;
|
||||
import techreborn.pda.GuiPda;
|
||||
import techreborn.tiles.TileAesu;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
import techreborn.tiles.TileAssemblingMachine;
|
||||
import techreborn.tiles.TileBlastFurnace;
|
||||
|
@ -72,6 +75,7 @@ public class GuiHandler implements IGuiHandler {
|
|||
public static final int platecuttingmachineID = 14;
|
||||
public static final int dieselGeneratorID = 15;
|
||||
public static final int industrialElectrolyzerID = 16;
|
||||
public static final int aesuID =17;
|
||||
|
||||
|
||||
|
||||
|
@ -143,6 +147,10 @@ public class GuiHandler implements IGuiHandler {
|
|||
{
|
||||
return new ContainerIndustrialElectrolyzer(
|
||||
(TileIndustrialElectrolyzer) world.getTileEntity(x, y, z), player);
|
||||
} else if (ID == aesuID)
|
||||
{
|
||||
return new ContainerAesu(
|
||||
(TileAesu) world.getTileEntity(x, y, z), player);
|
||||
} else if (ID == pdaID)
|
||||
{
|
||||
return null;
|
||||
|
@ -219,6 +227,10 @@ public class GuiHandler implements IGuiHandler {
|
|||
{
|
||||
return new GuiIndustrialElectrolyzer(player,
|
||||
(TileIndustrialElectrolyzer) world.getTileEntity(x, y, z));
|
||||
} else if (ID == aesuID)
|
||||
{
|
||||
return new GuiAesu(player,
|
||||
(TileAesu) world.getTileEntity(x, y, z));
|
||||
} else if (ID == pdaID)
|
||||
{
|
||||
return new GuiPda(player);
|
||||
|
|
52
src/main/java/techreborn/client/container/ContainerAesu.java
Normal file
52
src/main/java/techreborn/client/container/ContainerAesu.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
package techreborn.client.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import techreborn.client.SlotOutput;
|
||||
import techreborn.tiles.TileAesu;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
import techreborn.tiles.TileBlastFurnace;
|
||||
|
||||
public class ContainerAesu extends TechRebornContainer {
|
||||
|
||||
EntityPlayer player;
|
||||
|
||||
TileAesu tile;
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public int tickTime;
|
||||
|
||||
public ContainerAesu(TileAesu tileaesu,
|
||||
EntityPlayer player)
|
||||
{
|
||||
tile = tileaesu;
|
||||
this.player = player;
|
||||
|
||||
// input
|
||||
this.addSlotToContainer(new Slot(tileaesu.inventory, 0, 56, 25));
|
||||
this.addSlotToContainer(new Slot(tileaesu.inventory, 1, 56, 43));
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
50
src/main/java/techreborn/client/gui/GuiAesu.java
Normal file
50
src/main/java/techreborn/client/gui/GuiAesu.java
Normal file
|
@ -0,0 +1,50 @@
|
|||
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 techreborn.client.container.ContainerAesu;
|
||||
import techreborn.client.container.ContainerAlloySmelter;
|
||||
import techreborn.client.container.ContainerBlastFurnace;
|
||||
import techreborn.tiles.TileAesu;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
import techreborn.tiles.TileBlastFurnace;
|
||||
|
||||
public class GuiAesu extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
"techreborn", "textures/gui/aesu.png");
|
||||
|
||||
TileAesu aesu;
|
||||
|
||||
public GuiAesu(EntityPlayer player,
|
||||
TileAesu tileaesu)
|
||||
{
|
||||
super(new ContainerAesu(tileaesu, player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 167;
|
||||
aesu = tileaesu;
|
||||
}
|
||||
|
||||
@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.aesu.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