equivalent-exchange-3/src/main/java/com/pahimar/ee3/handler/GuiHandler.java

121 lines
5.4 KiB
Java
Raw Normal View History

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;
import com.pahimar.ee3.tileentity.*;
2013-08-23 16:59:50 +02:00
import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
2013-08-23 16:59:50 +02:00
public class GuiHandler implements IGuiHandler
{
2013-08-23 16:59:50 +02:00
@Override
public Object getServerGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z)
{
2014-09-19 21:55:28 +02:00
if (id == GUIs.ALCHEMICAL_CHEST.ordinal())
{
2014-04-30 03:46:59 +02:00
TileEntityAlchemicalChest tileEntityAlchemicalChest = (TileEntityAlchemicalChest) world.getTileEntity(x, y, z);
return new ContainerAlchemicalChest(entityPlayer.inventory, tileEntityAlchemicalChest);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.GLASS_BELL.ordinal())
{
2014-04-30 03:46:59 +02:00
TileEntityGlassBell tileEntityGlassBell = (TileEntityGlassBell) world.getTileEntity(x, y, z);
return new ContainerGlassBell(entityPlayer.inventory, tileEntityGlassBell);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.ALCHEMICAL_BAG.ordinal())
{
return new ContainerAlchemicalBag(entityPlayer, new InventoryAlchemicalBag(entityPlayer.getHeldItem()));
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.ALCHEMICAL_TOME.ordinal())
{
return new ContainerAlchemicalTome(entityPlayer);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.CALCINATOR.ordinal())
{
2014-07-03 21:44:44 +02:00
TileEntityCalcinator tileEntityCalcinator = (TileEntityCalcinator) world.getTileEntity(x, y, z);
return new ContainerCalcinator(entityPlayer.inventory, tileEntityCalcinator);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.ALUDEL.ordinal())
2014-07-04 22:11:39 +02:00
{
TileEntityAludel tileEntityAludel = (TileEntityAludel) world.getTileEntity(x, y, z);
return new ContainerAludel(entityPlayer.inventory, tileEntityAludel);
2014-07-04 22:11:39 +02:00
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.RESEARCH_STATION.ordinal())
{
TileEntityResearchStation tileEntityResearchStation = (TileEntityResearchStation) world.getTileEntity(x, y, z);
return new ContainerResearchStation(entityPlayer.inventory, tileEntityResearchStation);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.AUGMENTATION_TABLE.ordinal())
{
TileEntityAugmentationTable tileEntityAugmentationTable = (TileEntityAugmentationTable) world.getTileEntity(x, y, z);
return new ContainerAugmentationTable(entityPlayer.inventory, tileEntityAugmentationTable);
}
else if (id == GUIs.TRANSMUTATION_TABLET.ordinal())
{
TileEntityTransmutationTablet tileEntityTransmutationTablet = (TileEntityTransmutationTablet) world.getTileEntity(x, y, z);
return new ContainerTransmutationTablet(entityPlayer.inventory, tileEntityTransmutationTablet);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.SYMBOL_SELECTION.ordinal())
{
return new ContainerSymbolSelection();
}
2013-08-23 16:59:50 +02:00
return null;
}
@Override
public Object getClientGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z)
{
2014-09-19 21:55:28 +02:00
if (id == GUIs.ALCHEMICAL_CHEST.ordinal())
{
2014-04-30 03:46:59 +02:00
TileEntityAlchemicalChest tileEntityAlchemicalChest = (TileEntityAlchemicalChest) world.getTileEntity(x, y, z);
return new GuiAlchemicalChest(entityPlayer.inventory, tileEntityAlchemicalChest);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.GLASS_BELL.ordinal())
{
2014-04-30 03:46:59 +02:00
TileEntityGlassBell tileEntityGlassBell = (TileEntityGlassBell) world.getTileEntity(x, y, z);
return new GuiGlassBell(entityPlayer.inventory, tileEntityGlassBell);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.ALCHEMICAL_BAG.ordinal())
{
return new GuiAlchemicalBag(entityPlayer, new InventoryAlchemicalBag(entityPlayer.getHeldItem()));
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.ALCHEMICAL_TOME.ordinal())
{
return new GuiAlchemicalTome(entityPlayer.inventory);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.CALCINATOR.ordinal())
{
2014-07-03 21:44:44 +02:00
TileEntityCalcinator tileEntityCalcinator = (TileEntityCalcinator) world.getTileEntity(x, y, z);
return new GuiCalcinator(entityPlayer.inventory, tileEntityCalcinator);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.ALUDEL.ordinal())
2014-07-04 22:11:39 +02:00
{
TileEntityAludel tileEntityAludel = (TileEntityAludel) world.getTileEntity(x, y, z);
return new GuiAludel(entityPlayer.inventory, tileEntityAludel);
2014-07-04 22:11:39 +02:00
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.RESEARCH_STATION.ordinal())
{
TileEntityResearchStation tileEntityResearchStation = (TileEntityResearchStation) world.getTileEntity(x, y, z);
return new GuiResearchStation(entityPlayer.inventory, tileEntityResearchStation);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.AUGMENTATION_TABLE.ordinal())
{
TileEntityAugmentationTable tileEntityAugmentationTable = (TileEntityAugmentationTable) world.getTileEntity(x, y, z);
return new GuiAugmentationTable(entityPlayer.inventory, tileEntityAugmentationTable);
}
else if (id == GUIs.TRANSMUTATION_TABLET.ordinal())
{
TileEntityTransmutationTablet tileEntityTransmutationTablet = (TileEntityTransmutationTablet) world.getTileEntity(x, y, z);
return new GuiTransmutationTablet(entityPlayer.inventory, tileEntityTransmutationTablet);
}
2014-09-19 21:55:28 +02:00
else if (id == GUIs.SYMBOL_SELECTION.ordinal())
{
return new GuiSymbolSelection();
}
2013-08-23 16:59:50 +02:00
return null;
}
}