Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.rexozz.pixelengine;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.inventory.InventoryBasic;
- import net.minecraft.world.World;
- import net.minecraftforge.fml.common.network.IGuiHandler;
- import net.rexozz.pixelengine.client.gui.GuiCopy;
- import net.rexozz.pixelengine.client.gui.GuiNPC;
- import net.rexozz.pixelengine.client.gui.GuiSelectorRename;
- import net.rexozz.pixelengine.entity.EntityNPC;
- import net.rexozz.pixelengine.server.container.ContainerNPC;
- public class PEGuiHandler implements IGuiHandler{
- public static final int SELGUI=0,
- COPGUI=1,
- NPCGUI=2;
- public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- switch(ID){
- case SELGUI:
- return null;
- case COPGUI:
- return null;
- case NPCGUI:
- EntityNPC npc=(EntityNPC)world.getEntityByID(x);
- return new ContainerNPC(player.inventory, npc.inventory, npc, player);
- }
- return null;
- }
- public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
- switch(ID){
- case SELGUI:
- return new GuiSelectorRename();
- case COPGUI:
- return new GuiCopy(x);
- case NPCGUI:
- EntityNPC npc=(EntityNPC)world.getEntityByID(x);
- return new GuiNPC(player.inventory, new InventoryBasic(npc.inventory.getDisplayName(), npc.inventory.getSizeInventory()), npc);
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment