Guest User

Untitled

a guest
Nov 9th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. package tutorial.generic;
  2.  
  3. import net.minecraft.entity.player.EntityPlayer;
  4. import net.minecraft.tileentity.TileEntity;
  5. import net.minecraft.world.World;
  6. import cpw.mods.fml.common.network.IGuiHandler;
  7.  
  8. public class GuiHandler implements IGuiHandler {
  9. // returns an instance of the Container you made earlier
  10. @Override
  11. public Object getServerGuiElement(int ID, EntityPlayer player, World world,
  12. int x, int y, int z) {
  13. if (ID == 0) {
  14. TileEntityEnderFurnace tileEntityEnderFurnace = (TileEntityEnderFurnace) world
  15. .getTileEntity(x, y, z);
  16. return new ContainerEnderFurnace(player.inventory,
  17. tileEntityEnderFurnace);
  18. }
  19.  
  20. return null;
  21. }
  22.  
  23. @Override
  24. public Object getClientGuiElement(int ID, EntityPlayer player, World world,
  25. int x, int y, int z) {
  26. if (ID == 0) {
  27. TileEntityEnderFurnace tileEntityTestContainer = (TileEntityEnderFurnace) world
  28. .getTileEntity(x, y, z);
  29. return new GuiEnderFurnace(player.inventory,
  30. tileEntityTestContainer);
  31. }
  32.  
  33. return null;
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment