Java 类net.minecraft.client.gui.GuiScreenDemo 实例源码

项目:RuneCraftery    文件:NetClientHandler.java   
public void func_72488_a(Packet70GameEvent p_72488_1_) {
   EntityClientPlayerMP var2 = this.field_72563_h.field_71439_g;
   int var3 = p_72488_1_.field_73618_b;
   int var4 = p_72488_1_.field_73619_c;
   if(var3 >= 0 && var3 < Packet70GameEvent.field_73620_a.length && Packet70GameEvent.field_73620_a[var3] != null) {
      var2.func_71035_c(Packet70GameEvent.field_73620_a[var3]);
   }

   if(var3 == 1) {
      this.field_72564_i.func_72912_H().func_76084_b(true);
      this.field_72564_i.func_72894_k(0.0F);
   } else if(var3 == 2) {
      this.field_72564_i.func_72912_H().func_76084_b(false);
      this.field_72564_i.func_72894_k(1.0F);
   } else if(var3 == 3) {
      this.field_72563_h.field_71442_b.func_78746_a(EnumGameType.func_77146_a(var4));
   } else if(var3 == 4) {
      this.field_72563_h.func_71373_a(new GuiWinGame());
   } else if(var3 == 5) {
      GameSettings var5 = this.field_72563_h.field_71474_y;
      if(var4 == 0) {
         this.field_72563_h.func_71373_a(new GuiScreenDemo());
      } else if(var4 == 101) {
         this.field_72563_h.field_71456_v.func_73827_b().func_73757_a("demo.help.movement", new Object[]{Keyboard.getKeyName(var5.field_74351_w.field_74512_d), Keyboard.getKeyName(var5.field_74370_x.field_74512_d), Keyboard.getKeyName(var5.field_74368_y.field_74512_d), Keyboard.getKeyName(var5.field_74366_z.field_74512_d)});
      } else if(var4 == 102) {
         this.field_72563_h.field_71456_v.func_73827_b().func_73757_a("demo.help.jump", new Object[]{Keyboard.getKeyName(var5.field_74314_A.field_74512_d)});
      } else if(var4 == 103) {
         this.field_72563_h.field_71456_v.func_73827_b().func_73757_a("demo.help.inventory", new Object[]{Keyboard.getKeyName(var5.field_74315_B.field_74512_d)});
      }
   } else if(var3 == 6) {
      this.field_72564_i.func_72980_b(var2.field_70165_t, var2.field_70163_u + (double)var2.func_70047_e(), var2.field_70161_v, "random.successful_hit", 0.18F, 0.45F, false);
   }

}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
public void handleChangeGameState(S2BPacketChangeGameState packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.thePlayer;
    int i = packetIn.getGameState();
    float f = packetIn.func_149137_d();
    int j = MathHelper.floor_float(f + 0.5F);

    if (i >= 0 && i < S2BPacketChangeGameState.MESSAGE_NAMES.length && S2BPacketChangeGameState.MESSAGE_NAMES[i] != null)
    {
        entityplayer.addChatComponentMessage(new ChatComponentTranslation(S2BPacketChangeGameState.MESSAGE_NAMES[i], new Object[0]));
    }

    if (i == 1)
    {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.gameController.playerController.setGameType(WorldSettings.GameType.getByID(j));
    }
    else if (i == 4)
    {
        this.gameController.displayGuiScreen(new GuiWinGame());
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.gameController.gameSettings;

        if (f == 0.0F)
        {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        }
        else if (f == 101.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.movement", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}));
        }
        else if (f == 102.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}));
        }
        else if (f == 103.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}));
        }
    }
    else if (i == 6)
    {
        this.clientWorldController.playSound(entityplayer.posX, entityplayer.posY + (double)entityplayer.getEyeHeight(), entityplayer.posZ, "random.successful_hit", 0.18F, 0.45F, false);
    }
    else if (i == 7)
    {
        this.clientWorldController.setRainStrength(f);
    }
    else if (i == 8)
    {
        this.clientWorldController.setThunderStrength(f);
    }
    else if (i == 10)
    {
        this.clientWorldController.spawnParticle(EnumParticleTypes.MOB_APPEARANCE, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
        this.clientWorldController.playSound(entityplayer.posX, entityplayer.posY, entityplayer.posZ, "mob.guardian.curse", 1.0F, 1.0F, false);
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
public void handleChangeGameState(S2BPacketChangeGameState packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.thePlayer;
    int i = packetIn.getGameState();
    float f = packetIn.func_149137_d();
    int j = MathHelper.floor_float(f + 0.5F);

    if (i >= 0 && i < S2BPacketChangeGameState.MESSAGE_NAMES.length && S2BPacketChangeGameState.MESSAGE_NAMES[i] != null)
    {
        entityplayer.addChatComponentMessage(new ChatComponentTranslation(S2BPacketChangeGameState.MESSAGE_NAMES[i], new Object[0]));
    }

    if (i == 1)
    {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.gameController.playerController.setGameType(WorldSettings.GameType.getByID(j));
    }
    else if (i == 4)
    {
        this.gameController.displayGuiScreen(new GuiWinGame());
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.gameController.gameSettings;

        if (f == 0.0F)
        {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        }
        else if (f == 101.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.movement", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}));
        }
        else if (f == 102.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}));
        }
        else if (f == 103.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}));
        }
    }
    else if (i == 6)
    {
        this.clientWorldController.playSound(entityplayer.posX, entityplayer.posY + (double)entityplayer.getEyeHeight(), entityplayer.posZ, "random.successful_hit", 0.18F, 0.45F, false);
    }
    else if (i == 7)
    {
        this.clientWorldController.setRainStrength(f);
    }
    else if (i == 8)
    {
        this.clientWorldController.setThunderStrength(f);
    }
    else if (i == 10)
    {
        this.clientWorldController.spawnParticle(EnumParticleTypes.MOB_APPEARANCE, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
        this.clientWorldController.playSound(entityplayer.posX, entityplayer.posY, entityplayer.posZ, "mob.guardian.curse", 1.0F, 1.0F, false);
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
public void handleChangeGameState(S2BPacketChangeGameState packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.thePlayer;
    int i = packetIn.getGameState();
    float f = packetIn.func_149137_d();
    int j = MathHelper.floor_float(f + 0.5F);

    if (i >= 0 && i < S2BPacketChangeGameState.MESSAGE_NAMES.length
            && S2BPacketChangeGameState.MESSAGE_NAMES[i] != null) {
        entityplayer.addChatComponentMessage(
                new ChatComponentTranslation(S2BPacketChangeGameState.MESSAGE_NAMES[i], new Object[0]));
    }

    if (i == 1) {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    } else if (i == 2) {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    } else if (i == 3) {
        this.gameController.playerController.setGameType(WorldSettings.GameType.getByID(j));
    } else if (i == 4) {
        this.gameController.displayGuiScreen(new GuiWinGame());
    } else if (i == 5) {
        GameSettings gamesettings = this.gameController.gameSettings;

        if (f == 0.0F) {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        } else if (f == 101.0F) {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation(
                    "demo.help.movement",
                    new Object[] { GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()),
                            GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()),
                            GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()),
                            GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode()) }));
        } else if (f == 102.0F) {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation(
                    "demo.help.jump",
                    new Object[] { GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode()) }));
        } else if (f == 103.0F) {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation(
                    "demo.help.inventory",
                    new Object[] { GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode()) }));
        }
    } else if (i == 6) {
        this.clientWorldController.playSound(entityplayer.posX,
                entityplayer.posY + (double) entityplayer.getEyeHeight(), entityplayer.posZ,
                "random.successful_hit", 0.18F, 0.45F, false);
    } else if (i == 7) {
        this.clientWorldController.setRainStrength(f);
    } else if (i == 8) {
        this.clientWorldController.setThunderStrength(f);
    } else if (i == 10) {
        this.clientWorldController.spawnParticle(EnumParticleTypes.MOB_APPEARANCE, entityplayer.posX,
                entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
        this.clientWorldController.playSound(entityplayer.posX, entityplayer.posY, entityplayer.posZ,
                "mob.guardian.curse", 1.0F, 1.0F, false);
    }
}
项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
public void handleChangeGameState(SPacketChangeGameState packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.player;
    int i = packetIn.getGameState();
    float f = packetIn.getValue();
    int j = MathHelper.floor(f + 0.5F);

    if (i >= 0 && i < SPacketChangeGameState.MESSAGE_NAMES.length && SPacketChangeGameState.MESSAGE_NAMES[i] != null)
    {
        entityplayer.addChatComponentMessage(new TextComponentTranslation(SPacketChangeGameState.MESSAGE_NAMES[i], new Object[0]), false);
    }

    if (i == 1)
    {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.gameController.playerController.setGameType(GameType.getByID(j));
    }
    else if (i == 4)
    {
        if (j == 0)
        {
            this.gameController.player.connection.sendPacket(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
            this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
        }
        else if (j == 1)
        {
            this.gameController.displayGuiScreen(new GuiWinGame());
        }
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.gameController.gameSettings;

        if (f == 0.0F)
        {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        }
        else if (f == 101.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.movement", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}));
        }
        else if (f == 102.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}));
        }
        else if (f == 103.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}));
        }
    }
    else if (i == 6)
    {
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY + (double)entityplayer.getEyeHeight(), entityplayer.posZ, SoundEvents.ENTITY_ARROW_HIT_PLAYER, SoundCategory.PLAYERS, 0.18F, 0.45F);
    }
    else if (i == 7)
    {
        this.clientWorldController.setRainStrength(f);
    }
    else if (i == 8)
    {
        this.clientWorldController.setThunderStrength(f);
    }
    else if (i == 10)
    {
        this.clientWorldController.spawnParticle(EnumParticleTypes.MOB_APPEARANCE, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY, entityplayer.posZ, SoundEvents.ENTITY_ELDER_GUARDIAN_CURSE, SoundCategory.HOSTILE, 1.0F, 1.0F);
    }
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
public void handleChangeGameState(SPacketChangeGameState packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.player;
    int i = packetIn.getGameState();
    float f = packetIn.getValue();
    int j = MathHelper.floor(f + 0.5F);

    if (i >= 0 && i < SPacketChangeGameState.MESSAGE_NAMES.length && SPacketChangeGameState.MESSAGE_NAMES[i] != null)
    {
        entityplayer.addChatComponentMessage(new TextComponentTranslation(SPacketChangeGameState.MESSAGE_NAMES[i], new Object[0]), false);
    }

    if (i == 1)
    {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.gameController.playerController.setGameType(GameType.getByID(j));
    }
    else if (i == 4)
    {
        if (j == 0)
        {
            this.gameController.player.connection.sendPacket(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
            this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
        }
        else if (j == 1)
        {
            this.gameController.displayGuiScreen(new GuiWinGame());
        }
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.gameController.gameSettings;

        if (f == 0.0F)
        {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        }
        else if (f == 101.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.movement", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}));
        }
        else if (f == 102.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}));
        }
        else if (f == 103.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}));
        }
    }
    else if (i == 6)
    {
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY + (double)entityplayer.getEyeHeight(), entityplayer.posZ, SoundEvents.ENTITY_ARROW_HIT_PLAYER, SoundCategory.PLAYERS, 0.18F, 0.45F);
    }
    else if (i == 7)
    {
        this.clientWorldController.setRainStrength(f);
    }
    else if (i == 8)
    {
        this.clientWorldController.setThunderStrength(f);
    }
    else if (i == 10)
    {
        this.clientWorldController.spawnParticle(EnumParticleTypes.MOB_APPEARANCE, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY, entityplayer.posZ, SoundEvents.ENTITY_ELDER_GUARDIAN_CURSE, SoundCategory.HOSTILE, 1.0F, 1.0F);
    }
}
项目:CustomWorldGen    文件:NetHandlerPlayClient.java   
public void handleChangeGameState(SPacketChangeGameState packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.thePlayer;
    int i = packetIn.getGameState();
    float f = packetIn.getValue();
    int j = MathHelper.floor_float(f + 0.5F);

    if (i >= 0 && i < SPacketChangeGameState.MESSAGE_NAMES.length && SPacketChangeGameState.MESSAGE_NAMES[i] != null)
    {
        entityplayer.addChatComponentMessage(new TextComponentTranslation(SPacketChangeGameState.MESSAGE_NAMES[i], new Object[0]));
    }

    if (i == 1)
    {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.gameController.playerController.setGameType(GameType.getByID(j));
    }
    else if (i == 4)
    {
        if (j == 0)
        {
            this.gameController.thePlayer.connection.sendPacket(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
            this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
        }
        else if (j == 1)
        {
            this.gameController.displayGuiScreen(new GuiWinGame());
        }
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.gameController.gameSettings;

        if (f == 0.0F)
        {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        }
        else if (f == 101.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.movement", new Object[] {gamesettings.keyBindForward.getDisplayName(), gamesettings.keyBindLeft.getDisplayName(), gamesettings.keyBindBack.getDisplayName(), gamesettings.keyBindRight.getDisplayName()}));
        }
        else if (f == 102.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.jump", new Object[] {gamesettings.keyBindJump.getDisplayName()}));
        }
        else if (f == 103.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.inventory", new Object[] {gamesettings.keyBindInventory.getDisplayName()}));
        }
    }
    else if (i == 6)
    {
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY + (double)entityplayer.getEyeHeight(), entityplayer.posZ, SoundEvents.ENTITY_ARROW_HIT_PLAYER, SoundCategory.PLAYERS, 0.18F, 0.45F);
    }
    else if (i == 7)
    {
        this.clientWorldController.setRainStrength(f);
    }
    else if (i == 8)
    {
        this.clientWorldController.setThunderStrength(f);
    }
    else if (i == 10)
    {
        this.clientWorldController.spawnParticle(EnumParticleTypes.MOB_APPEARANCE, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY, entityplayer.posZ, SoundEvents.ENTITY_ELDER_GUARDIAN_CURSE, SoundCategory.HOSTILE, 1.0F, 1.0F);
    }
}
项目:Resilience-Client-Source    文件:NetHandlerPlayClient.java   
public void handleChangeGameState(S2BPacketChangeGameState p_147252_1_)
{
    EntityClientPlayerMP var2 = this.gameController.thePlayer;
    int var3 = p_147252_1_.func_149138_c();
    float var4 = p_147252_1_.func_149137_d();
    int var5 = MathHelper.floor_float(var4 + 0.5F);

    if (var3 >= 0 && var3 < S2BPacketChangeGameState.field_149142_a.length && S2BPacketChangeGameState.field_149142_a[var3] != null)
    {
        var2.addChatComponentMessage(new ChatComponentTranslation(S2BPacketChangeGameState.field_149142_a[var3], new Object[0]));
    }

    if (var3 == 1)
    {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    }
    else if (var3 == 2)
    {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    }
    else if (var3 == 3)
    {
        this.gameController.playerController.setGameType(WorldSettings.GameType.getByID(var5));
    }
    else if (var3 == 4)
    {
        this.gameController.displayGuiScreen(new GuiWinGame());
    }
    else if (var3 == 5)
    {
        GameSettings var6 = this.gameController.gameSettings;

        if (var4 == 0.0F)
        {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        }
        else if (var4 == 101.0F)
        {
            this.gameController.ingameGUI.getChatGUI().func_146227_a(new ChatComponentTranslation("demo.help.movement", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(var6.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(var6.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(var6.keyBindRight.getKeyCode())}));
        }
        else if (var4 == 102.0F)
        {
            this.gameController.ingameGUI.getChatGUI().func_146227_a(new ChatComponentTranslation("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindJump.getKeyCode())}));
        }
        else if (var4 == 103.0F)
        {
            this.gameController.ingameGUI.getChatGUI().func_146227_a(new ChatComponentTranslation("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindInventory.getKeyCode())}));
        }
    }
    else if (var3 == 6)
    {
        this.clientWorldController.playSound(var2.posX, var2.posY + (double)var2.getEyeHeight(), var2.posZ, "random.successful_hit", 0.18F, 0.45F, false);
    }
    else if (var3 == 7)
    {
        this.clientWorldController.setRainStrength(var4);
    }
    else if (var3 == 8)
    {
        this.clientWorldController.setThunderStrength(var4);
    }
}
项目:ExpandedRailsMod    文件:NetHandlerPlayClient.java   
public void handleChangeGameState(SPacketChangeGameState packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    EntityPlayer entityplayer = this.gameController.thePlayer;
    int i = packetIn.getGameState();
    float f = packetIn.getValue();
    int j = MathHelper.floor_float(f + 0.5F);

    if (i >= 0 && i < SPacketChangeGameState.MESSAGE_NAMES.length && SPacketChangeGameState.MESSAGE_NAMES[i] != null)
    {
        entityplayer.addChatComponentMessage(new TextComponentTranslation(SPacketChangeGameState.MESSAGE_NAMES[i], new Object[0]));
    }

    if (i == 1)
    {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.gameController.playerController.setGameType(GameType.getByID(j));
    }
    else if (i == 4)
    {
        if (j == 0)
        {
            this.gameController.thePlayer.connection.sendPacket(new CPacketClientStatus(CPacketClientStatus.State.PERFORM_RESPAWN));
            this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
        }
        else if (j == 1)
        {
            this.gameController.displayGuiScreen(new GuiWinGame());
        }
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.gameController.gameSettings;

        if (f == 0.0F)
        {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        }
        else if (f == 101.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.movement", new Object[] {gamesettings.keyBindForward.getDisplayName(), gamesettings.keyBindLeft.getDisplayName(), gamesettings.keyBindBack.getDisplayName(), gamesettings.keyBindRight.getDisplayName()}));
        }
        else if (f == 102.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.jump", new Object[] {gamesettings.keyBindJump.getDisplayName()}));
        }
        else if (f == 103.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new TextComponentTranslation("demo.help.inventory", new Object[] {gamesettings.keyBindInventory.getDisplayName()}));
        }
    }
    else if (i == 6)
    {
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY + (double)entityplayer.getEyeHeight(), entityplayer.posZ, SoundEvents.ENTITY_ARROW_HIT_PLAYER, SoundCategory.PLAYERS, 0.18F, 0.45F);
    }
    else if (i == 7)
    {
        this.clientWorldController.setRainStrength(f);
    }
    else if (i == 8)
    {
        this.clientWorldController.setThunderStrength(f);
    }
    else if (i == 10)
    {
        this.clientWorldController.spawnParticle(EnumParticleTypes.MOB_APPEARANCE, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
        this.clientWorldController.playSound(entityplayer, entityplayer.posX, entityplayer.posY, entityplayer.posZ, SoundEvents.ENTITY_ELDER_GUARDIAN_CURSE, SoundCategory.HOSTILE, 1.0F, 1.0F);
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleChangeGameState(S2BPacketChangeGameState p_147252_1_)
{
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;
    int i = p_147252_1_.func_149138_c();
    float f = p_147252_1_.func_149137_d();
    int j = MathHelper.floor_float(f + 0.5F);

    if (i >= 0 && i < S2BPacketChangeGameState.field_149142_a.length && S2BPacketChangeGameState.field_149142_a[i] != null)
    {
        entityclientplayermp.addChatComponentMessage(new ChatComponentTranslation(S2BPacketChangeGameState.field_149142_a[i], new Object[0]));
    }

    if (i == 1)
    {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.gameController.playerController.setGameType(WorldSettings.GameType.getByID(j));
    }
    else if (i == 4)
    {
        this.gameController.displayGuiScreen(new GuiWinGame());
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.gameController.gameSettings;

        if (f == 0.0F)
        {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        }
        else if (f == 101.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.movement", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}));
        }
        else if (f == 102.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}));
        }
        else if (f == 103.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}));
        }
    }
    else if (i == 6)
    {
        this.clientWorldController.playSound(entityclientplayermp.posX, entityclientplayermp.posY + (double)entityclientplayermp.getEyeHeight(), entityclientplayermp.posZ, "random.successful_hit", 0.18F, 0.45F, false);
    }
    else if (i == 7)
    {
        this.clientWorldController.setRainStrength(f);
    }
    else if (i == 8)
    {
        this.clientWorldController.setThunderStrength(f);
    }
}
项目:Cauldron    文件:NetHandlerPlayClient.java   
public void handleChangeGameState(S2BPacketChangeGameState p_147252_1_)
{
    EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer;
    int i = p_147252_1_.func_149138_c();
    float f = p_147252_1_.func_149137_d();
    int j = MathHelper.floor_float(f + 0.5F);

    if (i >= 0 && i < S2BPacketChangeGameState.field_149142_a.length && S2BPacketChangeGameState.field_149142_a[i] != null)
    {
        entityclientplayermp.addChatComponentMessage(new ChatComponentTranslation(S2BPacketChangeGameState.field_149142_a[i], new Object[0]));
    }

    if (i == 1)
    {
        this.clientWorldController.getWorldInfo().setRaining(true);
        this.clientWorldController.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.clientWorldController.getWorldInfo().setRaining(false);
        this.clientWorldController.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.gameController.playerController.setGameType(WorldSettings.GameType.getByID(j));
    }
    else if (i == 4)
    {
        this.gameController.displayGuiScreen(new GuiWinGame());
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.gameController.gameSettings;

        if (f == 0.0F)
        {
            this.gameController.displayGuiScreen(new GuiScreenDemo());
        }
        else if (f == 101.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.movement", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindForward.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindLeft.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindBack.getKeyCode()), GameSettings.getKeyDisplayString(gamesettings.keyBindRight.getKeyCode())}));
        }
        else if (f == 102.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindJump.getKeyCode())}));
        }
        else if (f == 103.0F)
        {
            this.gameController.ingameGUI.getChatGUI().printChatMessage(new ChatComponentTranslation("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(gamesettings.keyBindInventory.getKeyCode())}));
        }
    }
    else if (i == 6)
    {
        this.clientWorldController.playSound(entityclientplayermp.posX, entityclientplayermp.posY + (double)entityclientplayermp.getEyeHeight(), entityclientplayermp.posZ, "random.successful_hit", 0.18F, 0.45F, false);
    }
    else if (i == 7)
    {
        this.clientWorldController.setRainStrength(f);
    }
    else if (i == 8)
    {
        this.clientWorldController.setThunderStrength(f);
    }
}
项目:RuneCraftery    文件:NetClientHandler.java   
public void handleGameEvent(Packet70GameEvent par1Packet70GameEvent)
{
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;
    int i = par1Packet70GameEvent.eventType;
    int j = par1Packet70GameEvent.gameMode;

    if (i >= 0 && i < Packet70GameEvent.clientMessage.length && Packet70GameEvent.clientMessage[i] != null)
    {
        entityclientplayermp.addChatMessage(Packet70GameEvent.clientMessage[i]);
    }

    if (i == 1)
    {
        this.worldClient.getWorldInfo().setRaining(true);
        this.worldClient.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.worldClient.getWorldInfo().setRaining(false);
        this.worldClient.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.mc.playerController.setGameType(EnumGameType.getByID(j));
    }
    else if (i == 4)
    {
        this.mc.displayGuiScreen(new GuiWinGame());
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.mc.gameSettings;

        if (j == 0)
        {
            this.mc.displayGuiScreen(new GuiScreenDemo());
        }
        else if (j == 101)
        {
            this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.movement", new Object[] {Keyboard.getKeyName(gamesettings.keyBindForward.keyCode), Keyboard.getKeyName(gamesettings.keyBindLeft.keyCode), Keyboard.getKeyName(gamesettings.keyBindBack.keyCode), Keyboard.getKeyName(gamesettings.keyBindRight.keyCode)});
        }
        else if (j == 102)
        {
            this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.jump", new Object[] {Keyboard.getKeyName(gamesettings.keyBindJump.keyCode)});
        }
        else if (j == 103)
        {
            this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.inventory", new Object[] {Keyboard.getKeyName(gamesettings.keyBindInventory.keyCode)});
        }
    }
    else if (i == 6)
    {
        this.worldClient.playSound(entityclientplayermp.posX, entityclientplayermp.posY + (double)entityclientplayermp.getEyeHeight(), entityclientplayermp.posZ, "random.successful_hit", 0.18F, 0.45F, false);
    }
}
项目:BetterNutritionMod    文件:NetClientHandler.java   
public void handleGameEvent(Packet70GameEvent par1Packet70GameEvent)
{
    EntityClientPlayerMP entityclientplayermp = this.mc.thePlayer;
    int i = par1Packet70GameEvent.eventType;
    int j = par1Packet70GameEvent.gameMode;

    if (i >= 0 && i < Packet70GameEvent.clientMessage.length && Packet70GameEvent.clientMessage[i] != null)
    {
        entityclientplayermp.addChatMessage(Packet70GameEvent.clientMessage[i]);
    }

    if (i == 1)
    {
        this.worldClient.getWorldInfo().setRaining(true);
        this.worldClient.setRainStrength(0.0F);
    }
    else if (i == 2)
    {
        this.worldClient.getWorldInfo().setRaining(false);
        this.worldClient.setRainStrength(1.0F);
    }
    else if (i == 3)
    {
        this.mc.playerController.setGameType(EnumGameType.getByID(j));
    }
    else if (i == 4)
    {
        this.mc.displayGuiScreen(new GuiWinGame());
    }
    else if (i == 5)
    {
        GameSettings gamesettings = this.mc.gameSettings;

        if (j == 0)
        {
            this.mc.displayGuiScreen(new GuiScreenDemo());
        }
        else if (j == 101)
        {
            this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.movement", new Object[] {Keyboard.getKeyName(gamesettings.keyBindForward.keyCode), Keyboard.getKeyName(gamesettings.keyBindLeft.keyCode), Keyboard.getKeyName(gamesettings.keyBindBack.keyCode), Keyboard.getKeyName(gamesettings.keyBindRight.keyCode)});
        }
        else if (j == 102)
        {
            this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.jump", new Object[] {Keyboard.getKeyName(gamesettings.keyBindJump.keyCode)});
        }
        else if (j == 103)
        {
            this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.inventory", new Object[] {Keyboard.getKeyName(gamesettings.keyBindInventory.keyCode)});
        }
    }
    else if (i == 6)
    {
        this.worldClient.playSound(entityclientplayermp.posX, entityclientplayermp.posY + (double)entityclientplayermp.getEyeHeight(), entityclientplayermp.posZ, "random.successful_hit", 0.18F, 0.45F, false);
    }
}