Guest User

GuiHandler.java

a guest
Apr 21st, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.05 KB | None | 0 0
  1. package com.tristanvo.mod;
  2.  
  3. import cpw.mods.fml.common.network.IGuiHandler;
  4. import net.minecraft.entity.player.EntityPlayer;
  5. import net.minecraft.tileentity.TileEntity;
  6. import net.minecraft.world.World;
  7.  
  8. public class GuiHandler implements IGuiHandler {
  9.  
  10.     @Override
  11.     public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  12.         TileEntity entity = world.getTileEntity(x, y, z);
  13.        
  14.         if(ID == mod.guiIDMoriumWorkbench)
  15.         {
  16.             return ID == mod.guiIDMoriumWorkbench && world.getBlock(x, y, z) == mod.blockMoriumWorkbench ? new ContainerMoriumWorkbench(player.inventory, world, x, y, z) : null;
  17.         }
  18.         return null;
  19.     }
  20.     @Override
  21.     public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  22.         TileEntity entity = world.getTileEntity(x, y, z);
  23.        
  24.         if(ID == mod.guiIDMoriumWorkbench)
  25.         {
  26.             return ID == mod.guiIDMoriumWorkbench && world.getBlock(x, y, z) == mod.blockMoriumWorkbench ? new GuiMoriumWorkbench(player.inventory, world, x, y, z) : null;
  27.         }
  28.         return null;
  29.     }
  30. }
Add Comment
Please, Sign In to add comment