TristanvO

GuiHandler.java

Apr 10th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. package com.tristanvo.mod.gui;
  2.  
  3. import com.tristanvo.mod.blocks.moriumWorkbench;
  4.  
  5. import cpw.mods.fml.common.network.IGuiHandler;
  6. import net.minecraft.entity.player.EntityPlayer;
  7. import net.minecraft.world.World;
  8.  
  9. public class GuiHandler<ModTileEntity> implements IGuiHandler {
  10.  
  11.     public static final int tile_entity_gui = 0;
  12.    
  13.     @Override
  14.     public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
  15.     {
  16.         if(ID == tile_entity_gui)
  17.             return new ContainerModTileEntity(player.inventory, (moriumWorkbench) world.getTileEntity(new BlockPos(x, y, z)));
  18.  
  19.         return null;
  20.  
  21.     }
  22.     @Override
  23.     public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
  24.     {
  25.         if(ID == tile_entity_gui)
  26.             return new GuiCrafting(new ContainerModTileEntity(player.inventory, (moriumWorkbench) world.getTileEntity(new Blockpos(x, y, z))));
  27.  
  28.         return null;
  29.     }
  30. }
Add Comment
Please, Sign In to add comment