Advertisement
Guest User

Untitled

a guest
Feb 15th, 2014
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. package pirate.common;
  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 GuiHandlerTutorial implements IGuiHandler{
  9.     @Override
  10.         public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
  11.         {
  12.             TileEntity te = world.getBlockTileEntity(x, y, z);
  13.             if(te instanceof TileEntityBigChest)
  14.             {
  15.                 return new ContainerBigChest(player.inventory, (TileEntityBigChest)te);
  16.             }
  17.             return null;
  18.         }
  19.      
  20.         @Override
  21.         public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
  22.         {
  23.             TileEntity te = world.getBlockTileEntity(x, y, z);
  24.             if(te instanceof TileEntityBigChest)
  25.             {
  26.                 return new GuiBigChest(player.inventory, (TileEntityBigChest)te);
  27.             }
  28.             return null;
  29.         }
  30.      }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement