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 net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.BlockPos;
- import net.minecraft.util.ChatComponentTranslation;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.common.network.IGuiHandler;
- public class BioWarfareGuiHandler implements IGuiHandler {
- @Override
- public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
- BlockPos pos = BlockPos.ORIGIN;
- if (id == 0) {
- TileEntity tileEntity = world.getTileEntity(new BlockPos(x, y, z));
- if (tileEntity instanceof TileEntityMicrobeExtractor) {
- return new ContainerMicrobeExtractor(player.inventory, (TileEntityMicrobeExtractor) tileEntity);
- }
- }
- return null;
- }
- @Override
- public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
- if (id == 0) {
- TileEntity tileEntity = world.getTileEntity(new BlockPos(x, y, z));
- if (tileEntity instanceof TileEntityMicrobeExtractor) {
- return new GuiMicrobeExtractor(player.inventory, (TileEntityMicrobeExtractor) tileEntity);
- }
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment