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

128 lines
6.2 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
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
) {
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);
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()) {
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);
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);
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()) {
return new ContainerAdminPanel(entityPlayer.inventory);
}
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
) {
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);
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);
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);
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()) {
return new GuiAdminPanel(entityPlayer.inventory);
}
2013-08-23 16:59:50 +02:00
return null;
}
}