Guest User

Untitled

a guest
Sep 28th, 2014
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. package com.crilleslo.gui;
  2.  
  3. import com.crilleslo.container.ContainerWindmill;
  4. import com.crilleslo.tileentity.TileEntityWindmill;
  5.  
  6. import net.minecraft.entity.player.EntityPlayer;
  7. import net.minecraft.tileentity.TileEntity;
  8. import net.minecraft.world.World;
  9. import cpw.mods.fml.common.network.IGuiHandler;
  10.  
  11. public class GuiHandler implements IGuiHandler {
  12.  
  13. public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  14. TileEntity tileEntity = world.getTileEntity(x, y, z);
  15. switch(ID) {
  16. case 0:
  17. if(tileEntity instanceof TileEntityWindmill) return new ContainerWindmill(player.inventory, (TileEntityWindmill) tileEntity);
  18. default:
  19. return null;
  20. }
  21. }
  22.  
  23. public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  24. TileEntity tileEntity = world.getTileEntity(x, y, z);
  25. switch(ID) {
  26. case 0:
  27. if(tileEntity instanceof TileEntityWindmill) return new GuiWindmill(player.inventory, (TileEntityWindmill) tileEntity);
  28. default:
  29. return null;
  30. }
  31. }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment