Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.konarjg.arcticraft;
- import com.konarjg.arcticraft.blocks.tileentities.TileEntityBarrel;
- import com.konarjg.arcticraft.blocks.tileentities.TileEntityTheCore;
- import com.konarjg.arcticraft.blocks.tileentities.containers.ContainerBarrel;
- import com.konarjg.arcticraft.blocks.tileentities.containers.ContainerTheCore;
- import com.konarjg.arcticraft.blocks.tileentities.gui.GuiBarrel;
- import com.konarjg.arcticraft.blocks.tileentities.gui.GuiTheCore;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.inventory.Container;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.common.network.IGuiHandler;
- public class ModGuiHandler implements IGuiHandler {
- public static final int THE_CORE = 0;
- public static final int BARREL = 1;
- public static ModGuiHandler mgh;
- public ModGuiHandler () {
- mgh = this;
- }
- @Override
- public Container getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- switch (ID) {
- case THE_CORE:
- return new ContainerTheCore(player.inventory, (TileEntityTheCore)world.getTileEntity(new BlockPos(x, y, z)));
- case BARREL:
- return new ContainerBarrel(player.inventory, (TileEntityBarrel)world.getTileEntity(new BlockPos(x, y, z)));
- default:
- return null;
- }
- }
- @Override
- public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- switch (ID) {
- case THE_CORE:
- return new GuiTheCore(getServerGuiElement(ID, player, world, x, y, z), player.inventory);
- case BARREL:
- return new GuiBarrel(getServerGuiElement(ID, player, world, x, y, z), player.inventory);
- default:
- return null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment