当前位置: 首页>>代码示例>>Java>>正文


Java GuiScreenDemo类代码示例

本文整理汇总了Java中net.minecraft.client.gui.GuiScreenDemo的典型用法代码示例。如果您正苦于以下问题:Java GuiScreenDemo类的具体用法?Java GuiScreenDemo怎么用?Java GuiScreenDemo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GuiScreenDemo类属于net.minecraft.client.gui包,在下文中一共展示了GuiScreenDemo类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: func_72488_a

import net.minecraft.client.gui.GuiScreenDemo; //导入依赖的package包/类
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);
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:35,代码来源:NetClientHandler.java

示例2: handleChangeGameState

import net.minecraft.client.gui.GuiScreenDemo; //导入依赖的package包/类
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);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:71,代码来源:NetHandlerPlayClient.java

示例3: handleChangeGameState

import net.minecraft.client.gui.GuiScreenDemo; //导入依赖的package包/类
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);
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:60,代码来源:NetHandlerPlayClient.java

示例4: handleChangeGameState

import net.minecraft.client.gui.GuiScreenDemo; //导入依赖的package包/类
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);
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:79,代码来源:NetHandlerPlayClient.java

示例5: handleChangeGameState

import net.minecraft.client.gui.GuiScreenDemo; //导入依赖的package包/类
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);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:79,代码来源:NetHandlerPlayClient.java

示例6: handleChangeGameState

import net.minecraft.client.gui.GuiScreenDemo; //导入依赖的package包/类
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);
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:65,代码来源:NetHandlerPlayClient.java

示例7: handleChangeGameState

import net.minecraft.client.gui.GuiScreenDemo; //导入依赖的package包/类
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);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:65,代码来源:NetHandlerPlayClient.java

示例8: handleGameEvent

import net.minecraft.client.gui.GuiScreenDemo; //导入依赖的package包/类
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);
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:56,代码来源:NetClientHandler.java


注:本文中的net.minecraft.client.gui.GuiScreenDemo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。