Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.Looke81.BioWarfare.handler;
- import com.Looke81.BioWarfare.BioWarfare;
- import com.Looke81.BioWarfare.container.ContainerMicrobeExtractor;
- import com.Looke81.BioWarfare.gui.GuiMicrobeExtractor;
- import com.Looke81.BioWarfare.tileentity.TileEntityMicrobeExtractor;
- import coolalias.inventoryitem.ContainerItem;
- import coolalias.inventoryitem.InventoryItem;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.ItemStack;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.world.World;
- import cpw.mods.fml.common.network.IGuiHandler;
- public class GuiHandler1 implements IGuiHandler {
- @Override
- public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
- //System.out.println("This occurrs (client)" + id);
- if(id == 0) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- if(tileEntity instanceof TileEntityMicrobeExtractor){
- return new ContainerMicrobeExtractor(player.inventory, (TileEntityMicrobeExtractor) tileEntity);
- }
- }
- else if(id == 1) {
- return new ContainerItem(player, player.inventory, new InventoryItem(player.getHeldItem()));
- }
- return null;
- }
- //returns an instance of the Gui you made earlier
- @Override
- public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
- if(id == 0) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- if(tileEntity instanceof TileEntityMicrobeExtractor){
- return new ContainerMicrobeExtractor(player.inventory, (TileEntityMicrobeExtractor) tileEntity);
- }
- }
- else if(id == 1) {
- return new ContainerItem(player, player.inventory, new InventoryItem(player.getHeldItem()));
- }
- return null;
- }
- } package com.Looke81.BioWarfare.handler;
- import com.Looke81.BioWarfare.BioWarfare;
- import com.Looke81.BioWarfare.container.ContainerMicrobeExtractor;
- import com.Looke81.BioWarfare.gui.GuiMicrobeExtractor;
- import com.Looke81.BioWarfare.tileentity.TileEntityMicrobeExtractor;
- import coolalias.inventoryitem.ContainerItem;
- import coolalias.inventoryitem.InventoryItem;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.item.ItemStack;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.world.World;
- import cpw.mods.fml.common.network.IGuiHandler;
- public class GuiHandler1 implements IGuiHandler {
- @Override
- public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
- //System.out.println("This occurrs (client)" + id);
- if(id == 0) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- if(tileEntity instanceof TileEntityMicrobeExtractor){
- return new ContainerMicrobeExtractor(player.inventory, (TileEntityMicrobeExtractor) tileEntity);
- }
- }
- else if(id == 1) {
- return new ContainerItem(player, player.inventory, new InventoryItem(player.getHeldItem()));
- }
- return null;
- }
- //returns an instance of the Gui you made earlier
- @Override
- public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
- if(id == 0) {
- TileEntity tileEntity = world.getTileEntity(x, y, z);
- if(tileEntity instanceof TileEntityMicrobeExtractor){
- return new ContainerMicrobeExtractor(player.inventory, (TileEntityMicrobeExtractor) tileEntity);
- }
- }
- else if(id == 1) {
- return new ContainerItem(player, player.inventory, new InventoryItem(player.getHeldItem()));
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment