2013-12-21 23:16:55 +01:00
|
|
|
package com.pahimar.ee3.handler;
|
2013-08-23 16:59:50 +02:00
|
|
|
|
2014-07-04 22:11:39 +02:00
|
|
|
import com.pahimar.ee3.client.gui.inventory.*;
|
2014-07-03 21:44:44 +02:00
|
|
|
import com.pahimar.ee3.inventory.*;
|
2014-09-19 21:55:28 +02:00
|
|
|
import com.pahimar.ee3.reference.GUIs;
|
2014-07-07 03:47:57 +02:00
|
|
|
import com.pahimar.ee3.tileentity.*;
|
2013-08-23 16:59:50 +02:00
|
|
|
import cpw.mods.fml.common.network.IGuiHandler;
|
2013-12-16 02:26:42 +01:00
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.world.World;
|
2013-08-23 16:59:50 +02:00
|
|
|
|
2023-01-03 17:47:36 +01:00
|
|
|
public class GuiHandler implements IGuiHandler {
|
2013-08-23 16:59:50 +02:00
|
|
|
@Override
|
2023-01-03 17:47:36 +01:00
|
|
|
public Object getServerGuiElement(
|
|
|
|
int id, EntityPlayer entityPlayer, World world, int x, int y, int z
|
|
|
|
) {
|
2022-11-22 15:26:15 +01:00
|
|
|
if (id == GUIs.PORTABLE_CRAFTING.ordinal()) {
|
|
|
|
return new ContainerPortableCrafting(entityPlayer.inventory, world, x, y, z);
|
2023-01-03 17:47:36 +01:00
|
|
|
} else if (id == GUIs.ALCHEMICAL_CHEST.ordinal()) {
|
|
|
|
TileEntityAlchemicalChest tileEntityAlchemicalChest
|
|
|
|
= (TileEntityAlchemicalChest) world.getTileEntity(x, y, z);
|
|
|
|
return new ContainerAlchemicalChest(
|
|
|
|
entityPlayer.inventory, tileEntityAlchemicalChest
|
|
|
|
);
|
|
|
|
} else if (id == GUIs.GLASS_BELL.ordinal()) {
|
|
|
|
TileEntityGlassBell tileEntityGlassBell
|
|
|
|
= (TileEntityGlassBell) world.getTileEntity(x, y, z);
|
2014-07-18 21:55:10 +02:00
|
|
|
return new ContainerGlassBell(entityPlayer.inventory, tileEntityGlassBell);
|
2023-01-03 17:47:36 +01:00
|
|
|
} else if (id == GUIs.ALCHEMICAL_BAG.ordinal()) {
|
|
|
|
return new ContainerAlchemicalBag(
|
|
|
|
entityPlayer, new InventoryAlchemicalBag(entityPlayer.getHeldItem())
|
|
|
|
);
|
|
|
|
} else if (id == GUIs.ALCHENOMICON.ordinal()) {
|
2015-11-28 05:07:45 +01:00
|
|
|
return new ContainerAlchenomicon(entityPlayer, entityPlayer.getHeldItem());
|
2023-01-03 17:47:36 +01:00
|
|
|
} else if (id == GUIs.CALCINATOR.ordinal()) {
|
|
|
|
TileEntityCalcinator tileEntityCalcinator
|
|
|
|
= (TileEntityCalcinator) world.getTileEntity(x, y, z);
|
2014-07-18 21:55:10 +02:00
|
|
|
return new ContainerCalcinator(entityPlayer.inventory, tileEntityCalcinator);
|
2023-01-03 17:47:36 +01:00
|
|
|
} else if (id == GUIs.ALUDEL.ordinal()) {
|
|
|
|
TileEntityAludel tileEntityAludel
|
|
|
|
= (TileEntityAludel) world.getTileEntity(x, y, z);
|
2014-07-18 21:55:10 +02:00
|
|
|
return new ContainerAludel(entityPlayer.inventory, tileEntityAludel);
|
2023-01-03 17:47:36 +01:00
|
|
|
} else if (id == GUIs.RESEARCH_STATION.ordinal()) {
|
|
|
|
TileEntityResearchStation tileEntityResearchStation
|
|
|
|
= (TileEntityResearchStation) world.getTileEntity(x, y, z);
|
|
|
|
return new ContainerResearchStation(
|
|
|
|
entityPlayer.inventory, tileEntityResearchStation
|
|
|
|
);
|
|
|
|
} else if (id == GUIs.TRANSMUTATION_TABLET.ordinal()) {
|
|
|
|
TileEntityTransmutationTablet tileEntityTransmutationTablet
|
|
|
|
= (TileEntityTransmutationTablet) world.getTileEntity(x, y, z);
|
|
|
|
return new ContainerTransmutationTablet(
|
|
|
|
entityPlayer.inventory, tileEntityTransmutationTablet
|
|
|
|
);
|
|
|
|
} else if (id == GUIs.TRANSMUTATION_ARRAY.ordinal()) {
|
|
|
|
TileEntityAlchemyArray tileEntityAlchemyArray
|
|
|
|
= (TileEntityAlchemyArray) world.getTileEntity(x, y, z);
|
|
|
|
return new ContainerTransmutationArray(
|
|
|
|
entityPlayer.inventory, tileEntityAlchemyArray
|
|
|
|
);
|
|
|
|
} else if (id == GUIs.SYMBOL_SELECTION.ordinal()) {
|
2014-09-19 21:55:28 +02:00
|
|
|
return new ContainerSymbolSelection();
|
2023-01-03 17:47:36 +01:00
|
|
|
} else if (id == GUIs.ADMIN_PANEL.ordinal()) {
|
2015-11-28 05:07:45 +01:00
|
|
|
return new ContainerAdminPanel(entityPlayer.inventory);
|
|
|
|
}
|
2014-04-11 01:59:04 +02:00
|
|
|
|
2013-08-23 16:59:50 +02:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-01-03 17:47:36 +01:00
|
|
|
public Object getClientGuiElement(
|
|
|
|
int id, EntityPlayer entityPlayer, World world, int x, int y, int z
|
|
|
|
) {
|
2022-11-22 15:26:15 +01:00
|
|
|
if (id == GUIs.PORTABLE_CRAFTING.ordinal()) {
|
|
|
|
return new GuiPortableCrafting(entityPlayer, world, x, y, z);
|
2023-01-03 17:47:36 +01:00
|
|
|
} else if (id == GUIs.ALCHEMICAL_CHEST.ordinal()) {
|
|
|
|
TileEntityAlchemicalChest tileEntityAlchemicalChest
|
|
|
|
= (TileEntityAlchemicalChest) world.getTileEntity(x, y, z);
|
|
|
|
return new GuiAlchemicalChest(
|
|
|
|
entityPlayer.inventory, tileEntityAlchemicalChest
|
|
|
|
);
|
|
|
|
} else if (id == GUIs.GLASS_BELL.ordinal()) {
|
|
|
|
TileEntityGlassBell tileEntityGlassBell
|
|
|
|
= (TileEntityGlassBell) world.getTileEntity(x, y, z);
|
2014-07-18 21:55:10 +02:00
|
|
|
return new GuiGlassBell(entityPlayer.inventory, tileEntityGlassBell);
|
2023-01-03 17:47:36 +01:00
|
|
|
} else if (id == GUIs.ALCHEMICAL_BAG.ordinal()) {
|
|
|
|
return new GuiAlchemicalBag(
|
|
|
|
entityPlayer, new InventoryAlchemicalBag(entityPlayer.getHeldItem())
|
|
|
|
);
|
|
|
|
} else if (id == GUIs.ALCHENOMICON.ordinal()) {
|
|
|
|
return new GuiAlchenomicon(
|
|
|
|
entityPlayer.inventory, entityPlayer.getHeldItem()
|
|
|
|
);
|
|
|
|
} else if (id == GUIs.CALCINATOR.ordinal()) {
|
|
|
|
TileEntityCalcinator tileEntityCalcinator
|
|
|
|
= (TileEntityCalcinator) world.getTileEntity(x, y, z);
|
2014-07-18 21:55:10 +02:00
|
|
|
return new GuiCalcinator(entityPlayer.inventory, tileEntityCalcinator);
|
2023-01-03 17:47:36 +01:00
|
|
|
} else if (id == GUIs.ALUDEL.ordinal()) {
|
|
|
|
TileEntityAludel tileEntityAludel
|
|
|
|
= (TileEntityAludel) world.getTileEntity(x, y, z);
|
2014-07-18 21:55:10 +02:00
|
|
|
return new GuiAludel(entityPlayer.inventory, tileEntityAludel);
|
2023-01-03 17:47:36 +01:00
|
|
|
} else if (id == GUIs.RESEARCH_STATION.ordinal()) {
|
|
|
|
TileEntityResearchStation tileEntityResearchStation
|
|
|
|
= (TileEntityResearchStation) world.getTileEntity(x, y, z);
|
|
|
|
return new GuiResearchStation(
|
|
|
|
entityPlayer.inventory, tileEntityResearchStation
|
|
|
|
);
|
|
|
|
} else if (id == GUIs.TRANSMUTATION_TABLET.ordinal()) {
|
|
|
|
TileEntityTransmutationTablet tileEntityTransmutationTablet
|
|
|
|
= (TileEntityTransmutationTablet) world.getTileEntity(x, y, z);
|
|
|
|
return new GuiTransmutationTablet(
|
|
|
|
entityPlayer.inventory, tileEntityTransmutationTablet
|
|
|
|
);
|
|
|
|
} else if (id == GUIs.TRANSMUTATION_ARRAY.ordinal()) {
|
|
|
|
TileEntityAlchemyArray tileEntityAlchemyArray
|
|
|
|
= (TileEntityAlchemyArray) world.getTileEntity(x, y, z);
|
|
|
|
return new GuiTransmutationArray(
|
|
|
|
entityPlayer.inventory, tileEntityAlchemyArray
|
|
|
|
);
|
|
|
|
} else if (id == GUIs.SYMBOL_SELECTION.ordinal()) {
|
2014-09-19 21:55:28 +02:00
|
|
|
return new GuiSymbolSelection();
|
2023-01-03 17:47:36 +01:00
|
|
|
} else if (id == GUIs.ADMIN_PANEL.ordinal()) {
|
2015-11-28 05:07:45 +01:00
|
|
|
return new GuiAdminPanel(entityPlayer.inventory);
|
|
|
|
}
|
2014-04-11 01:59:04 +02:00
|
|
|
|
2013-08-23 16:59:50 +02:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|