Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. package greatblitz.testmod.common;
  2.  
  3. import greatblitz.testmod.client.gui.GuiContainerTileEntityTestBlock;
  4. import greatblitz.testmod.common.container.ContainerTileEntityTestBlock;
  5. import greatblitz.testmod.tileentity.TileEntityTestBlock;
  6. import net.minecraft.entity.player.EntityPlayer;
  7. import net.minecraft.util.math.BlockPos;
  8. import net.minecraft.world.World;
  9. import net.minecraftforge.fml.common.network.IGuiHandler;
  10.  
  11. public class GuiHandler implements IGuiHandler{
  12.  
  13. public static final int GUI_TILE_ENTITY_TEST_BLOCK = 0;
  14.  
  15. @Override
  16. public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  17. if (ID == GUI_TILE_ENTITY_TEST_BLOCK) return new ContainerTileEntityTestBlock(player.inventory, (TileEntityTestBlock) world.getTileEntity(new BlockPos(x, y, z)));
  18. return null;
  19. }
  20.  
  21. @Override
  22. public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  23. if (ID == GUI_TILE_ENTITY_TEST_BLOCK) return new GuiContainerTileEntityTestBlock(player.inventory, (TileEntityTestBlock) world.getTileEntity(new BlockPos(x, y, z)));
  24. return null;
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement