Guest User

Untitled

a guest
May 16th, 2015
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. package com.looke81.biowarfare.handler;
  2.  
  3. import com.looke81.biowarfare.BioWarfare;
  4. import com.looke81.biowarfare.container.ContainerMicrobeExtractor;
  5. import com.looke81.biowarfare.gui.GuiMicrobeExtractor;
  6. import com.looke81.biowarfare.tileentity.TileEntityMicrobeExtractor;
  7.  
  8. import net.minecraft.entity.player.EntityPlayer;
  9. import net.minecraft.tileentity.TileEntity;
  10. import net.minecraft.util.BlockPos;
  11. import net.minecraft.util.ChatComponentTranslation;
  12. import net.minecraft.world.World;
  13. import net.minecraftforge.fml.common.network.IGuiHandler;
  14.  
  15. public class BioWarfareGuiHandler implements IGuiHandler {
  16.  
  17. @Override
  18. public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
  19.  
  20. BlockPos pos = BlockPos.ORIGIN;
  21. if (id == 0) {
  22. TileEntity tileEntity = world.getTileEntity(new BlockPos(x, y, z));
  23. if (tileEntity instanceof TileEntityMicrobeExtractor) {
  24. return new ContainerMicrobeExtractor(player.inventory, (TileEntityMicrobeExtractor) tileEntity);
  25. }
  26. }
  27. return null;
  28. }
  29.  
  30. @Override
  31. public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
  32. if (id == 0) {
  33. TileEntity tileEntity = world.getTileEntity(new BlockPos(x, y, z));
  34. if (tileEntity instanceof TileEntityMicrobeExtractor) {
  35.  
  36. return new GuiMicrobeExtractor(player.inventory, (TileEntityMicrobeExtractor) tileEntity);
  37.  
  38. }
  39.  
  40. }
  41. return null;
  42. }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment