Advertisement
Creepinson

guihandler

Jul 10th, 2017
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. package me.creepinson.gui;
  2.  
  3. import me.creepinson.block.tileentitty.TileComputerCore;
  4. import net.minecraft.entity.player.EntityPlayer;
  5. import net.minecraft.tileentity.TileEntity;
  6. import net.minecraft.util.math.BlockPos;
  7. import net.minecraft.world.World;
  8. import net.minecraftforge.fml.common.network.IGuiHandler;
  9.  
  10. /**
  11. * Created by Creepinson on 7/10/2017.
  12. */
  13. public class GuiHandler implements IGuiHandler
  14. {
  15.  
  16.  
  17. @Override
  18. public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  19.  
  20. return null;
  21. }
  22.  
  23. @Override
  24. public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  25.  
  26. if(ID == 0){
  27.  
  28.  
  29.  
  30. TileEntity tileEntity = player.worldObj.getTileEntity(new BlockPos(x, y, z));
  31.  
  32. if(tileEntity instanceof TileComputerCore)
  33.  
  34. {
  35.  
  36. TileComputerCore computerCore = (TileComputerCore) tileEntity;
  37.  
  38. return new Computer(computerCore.getAppData(), x, y, z);
  39.  
  40. }
  41. }
  42. return null;
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement