Search in sources :

Example 1 with GuiShieldGeneratorConfig

use of stevekung.mods.moreplanets.client.gui.GuiShieldGeneratorConfig in project MorePlanets by SteveKunG.

the class PacketSimpleMP method handleClientSide.

@Override
@SideOnly(Side.CLIENT)
public void handleClientSide(EntityPlayer player) {
    BlockPos pos;
    switch(this.type) {
        case C_ADD_ENTITY_ID:
            String entityIDAdd = (String) this.data.get(0);
            if (!ClientEventHandler.entityId.contains(entityIDAdd)) {
                ClientEventHandler.entityId.add(entityIDAdd);
            }
            break;
        case C_REMOVE_ENTITY_ID:
            String entityIDRemove = (String) this.data.get(0);
            ClientEventHandler.entityId.remove(entityIDRemove);
            break;
        case C_REMOVE_GUIDE_POS:
            pos = (BlockPos) this.data.get(0);
            ClientEventHandler.receiverRenderPos.remove(pos);
            break;
        case C_RELOAD_RENDERER:
            ClientEventHandler.loadRenderers = true;
            break;
        case C_SWITCH_SHIELD_GENERATOR_GUI:
            pos = (BlockPos) this.data.get(0);
            boolean isConfig = (boolean) this.data.get(2);
            if (pos != null) {
                TileEntity tile = player.world.getTileEntity(pos);
                if (tile != null && tile instanceof TileEntityShieldGenerator) {
                    FMLClientHandler.instance().getClient().displayGuiScreen(isConfig ? new GuiShieldGeneratorConfig(player.inventory, (TileEntityShieldGenerator) tile) : new GuiShieldGenerator(player.inventory, (TileEntityShieldGenerator) tile));
                }
                player.openContainer.windowId = (Integer) this.data.get(1);
            }
            break;
        case C_REMOVE_GENERATOR_GUIDE_POS:
            pos = (BlockPos) this.data.get(0);
            ClientEventHandler.wasteRenderPos.remove(pos);
            break;
        default:
            break;
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) GuiShieldGeneratorConfig(stevekung.mods.moreplanets.client.gui.GuiShieldGeneratorConfig) TileEntityShieldGenerator(stevekung.mods.moreplanets.tileentity.TileEntityShieldGenerator) BlockPos(net.minecraft.util.math.BlockPos) GuiShieldGenerator(stevekung.mods.moreplanets.client.gui.GuiShieldGenerator) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

TileEntity (net.minecraft.tileentity.TileEntity)1 BlockPos (net.minecraft.util.math.BlockPos)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1 GuiShieldGenerator (stevekung.mods.moreplanets.client.gui.GuiShieldGenerator)1 GuiShieldGeneratorConfig (stevekung.mods.moreplanets.client.gui.GuiShieldGeneratorConfig)1 TileEntityShieldGenerator (stevekung.mods.moreplanets.tileentity.TileEntityShieldGenerator)1