ModMCdl

GuiHandler.java

Nov 2nd, 2017
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. package com.modmcdl.magitech.gui;
  2.  
  3. import com.modmcdl.magitech.tileenitity.TileEntityPestle;
  4.  
  5. import net.minecraft.entity.player.EntityPlayer;
  6. import net.minecraft.util.math.BlockPos;
  7. import net.minecraft.world.World;
  8. import net.minecraftforge.fml.common.network.IGuiHandler;
  9.  
  10. public class GuiHandler implements IGuiHandler{
  11.    
  12.     public static final int PESTLE_GUI = 0;
  13.    
  14.     @Override
  15.     public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  16.         if(ID == PESTLE_GUI)
  17.             return new ContainerPestle(player.inventory, ((TileEntityPestle)world.getTileEntity(new BlockPos(x, y, z))));
  18.         return null;
  19.     }
  20.  
  21.     @Override
  22.     public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
  23.         if(ID == PESTLE_GUI)
  24.             return new GuiPestle(player.inventory, ((TileEntityPestle)world.getTileEntity(new BlockPos(x, y, z))));
  25.         return null;
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment