use of logisticspipes.gui.GuiFirewall in project LogisticsPipes by RS485.
the class GuiHandler method getClientGuiElement.
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, final World world, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
LogisticsTileGenericPipe pipe = null;
if (tile instanceof LogisticsTileGenericPipe) {
pipe = (LogisticsTileGenericPipe) tile;
}
if (ID == -1) {
return getClientGuiElement(-100 * 20 + x, player, world, 0, -1, z);
}
if (ID < 110 && ID > 0) {
switch(ID) {
case GuiIDs.GUI_FluidSupplier_ID:
if (pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeItemsFluidSupplier)) {
return null;
}
return new GuiFluidSupplierPipe(player.inventory, ((PipeItemsFluidSupplier) pipe.pipe).getDummyInventory(), (PipeItemsFluidSupplier) pipe.pipe);
case GuiIDs.GUI_FluidSupplier_MK2_ID:
if (pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeFluidSupplierMk2)) {
return null;
}
return new GuiFluidSupplierMk2Pipe(player.inventory, ((PipeFluidSupplierMk2) pipe.pipe).getDummyInventory(), (PipeFluidSupplierMk2) pipe.pipe);
case GuiIDs.GUI_ProviderPipe_ID:
if (pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeItemsProviderLogistics)) {
return null;
}
return new GuiProviderPipe(player.inventory, ((PipeItemsProviderLogistics) pipe.pipe).getprovidingInventory(), (PipeItemsProviderLogistics) pipe.pipe);
case GuiIDs.GUI_SatellitePipe_ID:
if (pipe != null && pipe.pipe != null && pipe.pipe instanceof PipeItemsSatelliteLogistics) {
return new GuiSatellitePipe((PipeItemsSatelliteLogistics) pipe.pipe, player);
}
if (pipe != null && pipe.pipe != null && pipe.pipe instanceof PipeFluidSatellite) {
return new GuiSatellitePipe((PipeFluidSatellite) pipe.pipe, player);
}
return null;
case GuiIDs.GUI_Normal_Orderer_ID:
return new NormalGuiOrderer(x, y, z, MainProxy.getDimensionForWorld(world), player);
case GuiIDs.GUI_Normal_Mk2_Orderer_ID:
if (pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeItemsRequestLogisticsMk2)) {
return null;
}
return new NormalMk2GuiOrderer(((PipeItemsRequestLogisticsMk2) pipe.pipe), player);
case GuiIDs.GUI_Fluid_Orderer_ID:
if (pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeFluidRequestLogistics)) {
return null;
}
return new FluidGuiOrderer(((PipeFluidRequestLogistics) pipe.pipe), player);
case GuiIDs.GUI_Inv_Sys_Connector_ID:
if (pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeItemsInvSysConnector)) {
return null;
}
return new GuiInvSysConnector(player, (PipeItemsInvSysConnector) pipe.pipe);
case GuiIDs.GUI_Freq_Card_ID:
if (pipe == null || pipe.pipe == null || !((pipe.pipe instanceof PipeItemsSystemEntranceLogistics) || (pipe.pipe instanceof PipeItemsSystemDestinationLogistics))) {
return null;
}
IInventory inv = null;
if (pipe.pipe instanceof PipeItemsSystemEntranceLogistics) {
inv = ((PipeItemsSystemEntranceLogistics) pipe.pipe).inv;
} else if (pipe.pipe instanceof PipeItemsSystemDestinationLogistics) {
inv = ((PipeItemsSystemDestinationLogistics) pipe.pipe).inv;
}
return new GuiFreqCardContent(player, inv);
case GuiIDs.GUI_HUD_Settings:
return new GuiHUDSettings(player, x);
case GuiIDs.GUI_Fluid_Basic_ID:
if (pipe == null || pipe.pipe == null || !((pipe.pipe instanceof PipeFluidBasic))) {
return null;
}
return new GuiFluidBasic(player, ((PipeFluidBasic) pipe.pipe).filterInv);
case GuiIDs.GUI_FIREWALL:
if (pipe == null || pipe.pipe == null || !((pipe.pipe instanceof PipeItemsFirewall))) {
return null;
}
return new GuiFirewall((PipeItemsFirewall) pipe.pipe, player);
case GuiIDs.GUI_Request_Table_ID:
if (pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeBlockRequestTable)) {
return null;
}
return new GuiRequestTable(player, ((PipeBlockRequestTable) pipe.pipe));
default:
break;
}
}
return null;
}
Aggregations