#614 Combustion Gen GUI did not show user inventory.

This commit is contained in:
CrazyPants committed 2014-04-27 13:40:35 +08:00
1 parent fb5c245aa5
commit 7e6cd1c1c5
3 files changed
+27 -2

No files matched your search

@@ -72,12 +72,20 @@ public class BlockCombustionGenerator extends AbstractMachineBlock<TileCombustio
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity te = world.getTileEntity(x, y, z);
if(te instanceof TileCombustionGenerator) {
return new ContainerCombustionEngine(player.inventory, (TileCombustionGenerator)te);
}
return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new GuiCombustionGenerator(player.inventory, (TileCombustionGenerator) world.getTileEntity(x, y, z));
TileEntity te = world.getTileEntity(x, y, z);
if(te instanceof TileCombustionGenerator) {
return new GuiCombustionGenerator(player.inventory, (TileCombustionGenerator) te);
}
return null;
}
@Override
@@ -0,0 +1,17 @@
package crazypants.enderio.machine.generator;
import net.minecraft.entity.player.InventoryPlayer;
import crazypants.enderio.machine.AbstractMachineContainer;
import crazypants.enderio.machine.AbstractMachineEntity;
public class ContainerCombustionEngine extends AbstractMachineContainer {
public ContainerCombustionEngine(InventoryPlayer playerInv, AbstractMachineEntity te) {
super(playerInv, te);
}
@Override
protected void addMachineSlots(InventoryPlayer playerInv) {
}
}
@@ -24,7 +24,7 @@ public class GuiCombustionGenerator extends GuiMachineBase {
private TileCombustionGenerator gen;
public GuiCombustionGenerator(InventoryPlayer par1InventoryPlayer, TileCombustionGenerator te) {
super(te, new EmptyContainer());
super(te, new ContainerCombustionEngine(par1InventoryPlayer, te));
this.gen = te;
addToolTip(new GuiToolTip(new Rectangle(48, 21, 15, 47), "") {