use of mcjty.xnet.items.manual.GuiXNetManual in project XNet by McJty.
the class GuiProxy method getClientGuiElement.
@Override
public Object getClientGuiElement(int guiid, EntityPlayer entityPlayer, World world, int x, int y, int z) {
if (guiid == GUI_MANUAL_XNET) {
return new GuiXNetManual(GuiXNetManual.MANUAL_XNET);
}
BlockPos pos = new BlockPos(x, y, z);
Block block = world.getBlockState(pos).getBlock();
if (block instanceof GenericBlock) {
GenericBlock<?, ?> genericBlock = (GenericBlock<?, ?>) block;
TileEntity te = world.getTileEntity(pos);
return genericBlock.createClientGui(entityPlayer, te);
} else if (block instanceof ConnectorBlock) {
TileEntity te = world.getTileEntity(pos);
return new GuiConnector((ConnectorTileEntity) te, new EmptyContainer(entityPlayer, null));
}
return null;
}
Aggregations