Failing ;)

This commit is contained in:
Gig 2015-04-14 00:12:24 +01:00
parent 84ee22b859
commit 700276fb09
12 changed files with 387 additions and 1 deletions

View file

@ -6,14 +6,17 @@ import net.minecraft.world.World;
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.GuiCentrifuge;
import techreborn.client.gui.GuiQuantumChest;
import techreborn.client.gui.GuiQuantumTank;
import techreborn.client.gui.GuiRollingMachine;
import techreborn.client.gui.GuiThermalGenerator;
import techreborn.tiles.TileCentrifuge;
import techreborn.tiles.TileQuantumChest;
import techreborn.tiles.TileQuantumTank;
import techreborn.tiles.TileRollingMachine;
import techreborn.tiles.TileThermalGenerator;
import cpw.mods.fml.common.network.IGuiHandler;
@ -23,6 +26,7 @@ public class GuiHandler implements IGuiHandler {
public static final int quantumTankID = 1;
public static final int quantumChestID = 2;
public static final int centrifugeID = 3;
public static final int rollingMachineID =4;
@Override
@ -35,6 +39,8 @@ public class GuiHandler implements IGuiHandler {
return new ContainerQuantumChest((TileQuantumChest) world.getTileEntity(x, y, z), player);
} else if(ID == centrifugeID){
return new ContainerCentrifuge((TileCentrifuge) world.getTileEntity(x, y, z), player);
} else if(ID == rollingMachineID){
return new ContainerRollingMachine((TileRollingMachine) world.getTileEntity(x, y, z), player);
}
return null;
@ -50,6 +56,8 @@ public class GuiHandler implements IGuiHandler {
return new GuiQuantumChest(player, (TileQuantumChest)world.getTileEntity(x, y, z));
} else if(ID == centrifugeID){
return new GuiCentrifuge(player, (TileCentrifuge)world.getTileEntity(x, y, z));
} else if(ID == rollingMachineID){
return new GuiRollingMachine(player, (TileRollingMachine)world.getTileEntity(x, y, z));
}
return null;
}

View file

@ -0,0 +1,50 @@
package techreborn.client.container;
import techreborn.client.SlotOutput;
import techreborn.tiles.TileCentrifuge;
import techreborn.tiles.TileRollingMachine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
public class ContainerRollingMachine extends TechRebornContainer{
EntityPlayer player;
TileRollingMachine tile;
public ContainerRollingMachine(TileRollingMachine tileRollingmachine, EntityPlayer player){
tile = tileRollingmachine;
this.player = player;
//input
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 0, 30, 17));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 1, 30, 35));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 2, 30, 53));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 3, 48, 17));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 4, 48, 35));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 5, 48, 53));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 6, 66, 17));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 7, 66, 35));
this.addSlotToContainer(new Slot(tileRollingmachine.inventory, 8, 66, 53));
//outputs
this.addSlotToContainer(new SlotOutput(tileRollingmachine.inventory, 9, 124, 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));
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return true;
}
}

View file

@ -0,0 +1,33 @@
package techreborn.client.gui;
import techreborn.client.container.ContainerCentrifuge;
import techreborn.client.container.ContainerRollingMachine;
import techreborn.tiles.TileCentrifuge;
import techreborn.tiles.TileRollingMachine;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
public class GuiRollingMachine extends GuiContainer{
private static final ResourceLocation texture = new ResourceLocation("techreborn", "textures/gui/rollingmachine.png");
TileRollingMachine rollingMachine;
public GuiRollingMachine(EntityPlayer player, TileRollingMachine tileRollingmachine)
{
super(new ContainerRollingMachine(tileRollingmachine, player));
this.xSize = 176;
this.ySize = 167;
rollingMachine = tileRollingmachine;
}
@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);
}
}