Advertisement
hassansyyid

Untitled

Nov 11th, 2015
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1. package io.github.hsyyid.wilsonsmp;
  2.  
  3. import io.github.hsyyid.wilsonsmp.gui.GuiReadableBookshelf;
  4. import io.github.hsyyid.wilsonsmp.tileentities.TileEntityReadableBookshelf;
  5. import net.minecraft.entity.player.EntityPlayer;
  6. import net.minecraft.util.BlockPos;
  7. import net.minecraft.world.World;
  8. import net.minecraftforge.fml.common.network.IGuiHandler;
  9.  
  10. public class GuiHandler implements IGuiHandler
  11. {
  12.     @Override
  13.     public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
  14.     {
  15.         if (ID == 1)
  16.         {
  17.             TileEntityReadableBookshelf bookshelf = (TileEntityReadableBookshelf) (world.getTileEntity(new BlockPos(x, y, z)));
  18.             return bookshelf.getNewContainer(player);
  19.         }
  20.  
  21.         return null;
  22.     }
  23.  
  24.     @Override
  25.     public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
  26.     {
  27.         System.out.println("Haiaiaiai");
  28.        
  29.         if (ID == 1)
  30.         {
  31.             System.out.println("Opened GUI");
  32.             return new GuiReadableBookshelf(player, (TileEntityReadableBookshelf) (world.getTileEntity(new BlockPos(x, y, z))));
  33.         }
  34.  
  35.         return null;
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement