Java 类net.minecraft.network.packet.Packet70GameEvent 实例源码

项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_71027_c(int p_71027_1_) {
   if(this.field_71093_bK == 1 && p_71027_1_ == 1) {
      this.func_71029_a(AchievementList.field_76003_C);
      this.field_70170_p.func_72900_e(this);
      this.field_71136_j = true;
      this.field_71135_a.func_72567_b(new Packet70GameEvent(4, 0));
   } else {
      if(this.field_71093_bK == 0 && p_71027_1_ == 1) {
         this.func_71029_a(AchievementList.field_76002_B);
         ChunkCoordinates var2 = this.field_71133_b.func_71218_a(p_71027_1_).func_73054_j();
         if(var2 != null) {
            this.field_71135_a.func_72569_a((double)var2.field_71574_a, (double)var2.field_71572_b, (double)var2.field_71573_c, 0.0F, 0.0F);
         }

         p_71027_1_ = 1;
      } else {
         this.func_71029_a(AchievementList.field_76029_x);
      }

      this.field_71133_b.func_71203_ab().func_72356_a(this, p_71027_1_);
      this.field_71144_ck = -1;
      this.field_71149_ch = -1.0F;
      this.field_71146_ci = -1;
   }

}
项目:RuneCraftery    文件:WorldServer.java   
/**
 * Updates all weather states.
 */
protected void updateWeather()
{
    boolean flag = this.isRaining();
    super.updateWeather();

    if (flag != this.isRaining())
    {
        if (flag)
        {
            this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(2, 0));
        }
        else
        {
            this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(1, 0));
        }
    }
}
项目:BetterNutritionMod    文件:WorldServer.java   
/**
 * Updates all weather states.
 */
protected void updateWeather()
{
    boolean flag = this.isRaining();
    super.updateWeather();

    if (flag != this.isRaining())
    {
        if (flag)
        {
            this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(2, 0));
        }
        else
        {
            this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(1, 0));
        }
    }
}
项目:RuneCraftery    文件:DemoWorldManager.java   
public void func_73075_a() {
   super.func_73075_a();
   ++this.field_73102_f;
   long var1 = this.field_73092_a.func_82737_E();
   long var3 = var1 / 24000L + 1L;
   if(!this.field_73105_c && this.field_73102_f > 20) {
      this.field_73105_c = true;
      this.field_73090_b.field_71135_a.func_72567_b(new Packet70GameEvent(5, 0));
   }

   this.field_73103_d = var1 > 120500L;
   if(this.field_73103_d) {
      ++this.field_73104_e;
   }

   if(var1 % 24000L == 500L) {
      if(var3 <= 6L) {
         this.field_73090_b.func_70006_a(ChatMessageComponent.func_111077_e("demo.day." + var3));
      }
   } else if(var3 == 1L) {
      if(var1 == 100L) {
         this.field_73090_b.field_71135_a.func_72567_b(new Packet70GameEvent(5, 101));
      } else if(var1 == 175L) {
         this.field_73090_b.field_71135_a.func_72567_b(new Packet70GameEvent(5, 102));
      } else if(var1 == 250L) {
         this.field_73090_b.field_71135_a.func_72567_b(new Packet70GameEvent(5, 103));
      }
   } else if(var3 == 5L && var1 % 24000L == 22000L) {
      this.field_73090_b.func_70006_a(ChatMessageComponent.func_111077_e("demo.day.warning"));
   }

}
项目:RuneCraftery    文件:WorldServer.java   
protected void func_72979_l() {
   boolean var1 = this.func_72896_J();
   super.func_72979_l();
   if(var1 != this.func_72896_J()) {
      if(var1) {
         this.field_73061_a.func_71203_ab().func_72384_a(new Packet70GameEvent(2, 0));
      } else {
         this.field_73061_a.func_71203_ab().func_72384_a(new Packet70GameEvent(1, 0));
      }
   }

}
项目: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);
   }

}
项目:RuneCraftery    文件:ServerConfigurationManager.java   
public void func_72354_b(EntityPlayerMP p_72354_1_, WorldServer p_72354_2_) {
   p_72354_1_.field_71135_a.func_72567_b(new Packet4UpdateTime(p_72354_2_.func_82737_E(), p_72354_2_.func_72820_D(), p_72354_2_.func_82736_K().func_82766_b("doDaylightCycle")));
   if(p_72354_2_.func_72896_J()) {
      p_72354_1_.field_71135_a.func_72567_b(new Packet70GameEvent(1, 0));
   }

}
项目:RuneCraftery    文件:EntityPlayerMP.java   
/**
 * Teleports the entity to another dimension. Params: Dimension number to teleport to
 */
public void travelToDimension(int par1)
{
    if (this.dimension == 1 && par1 == 1)
    {
        this.triggerAchievement(AchievementList.theEnd2);
        this.worldObj.removeEntity(this);
        this.playerConqueredTheEnd = true;
        this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(4, 0));
    }
    else
    {
        if (this.dimension == 0 && par1 == 1)
        {
            this.triggerAchievement(AchievementList.theEnd);
            ChunkCoordinates chunkcoordinates = this.mcServer.worldServerForDimension(par1).getEntrancePortalLocation();

            if (chunkcoordinates != null)
            {
                this.playerNetServerHandler.setPlayerLocation((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ, 0.0F, 0.0F);
            }

            par1 = 1;
        }
        else
        {
            this.triggerAchievement(AchievementList.portal);
        }

        this.mcServer.getConfigurationManager().transferPlayerToDimension(this, par1);
        this.lastExperience = -1;
        this.lastHealth = -1.0F;
        this.lastFoodLevel = -1;
    }
}
项目:RuneCraftery    文件:ServerConfigurationManager.java   
/**
 * Updates the time and weather for the given player to those of the given world
 */
public void updateTimeAndWeatherForPlayer(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer)
{
    par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet4UpdateTime(par2WorldServer.getTotalWorldTime(), par2WorldServer.getWorldTime(), par2WorldServer.getGameRules().getGameRuleBooleanValue("doDaylightCycle")));

    if (par2WorldServer.isRaining())
    {
        par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(1, 0));
    }
}
项目:TeamCore    文件:DimensionTeleporter.java   
public static void updateTimeAndWeatherForPlayer(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer)
{
    par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet4UpdateTime(par2WorldServer.getTotalWorldTime(), par2WorldServer.getWorldTime(), par2WorldServer.getGameRules().getGameRuleBooleanValue("doDaylightCycle")));

    if (par2WorldServer.isRaining())
    {
        par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(1, 0));
    }
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
/**
 * Teleports the entity to another dimension. Params: Dimension number to teleport to
 */
public void travelToDimension(int par1)
{
    if (this.dimension == 1 && par1 == 1)
    {
        this.triggerAchievement(AchievementList.theEnd2);
        this.worldObj.removeEntity(this);
        this.playerConqueredTheEnd = true;
        this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(4, 0));
    }
    else
    {
        if (this.dimension == 0 && par1 == 1)
        {
            this.triggerAchievement(AchievementList.theEnd);
            ChunkCoordinates chunkcoordinates = this.mcServer.worldServerForDimension(par1).getEntrancePortalLocation();

            if (chunkcoordinates != null)
            {
                this.playerNetServerHandler.setPlayerLocation((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ, 0.0F, 0.0F);
            }

            par1 = 1;
        }
        else
        {
            this.triggerAchievement(AchievementList.portal);
        }

        this.mcServer.getConfigurationManager().transferPlayerToDimension(this, par1);
        this.lastExperience = -1;
        this.lastHealth = -1.0F;
        this.lastFoodLevel = -1;
    }
}
项目:BetterNutritionMod    文件:ServerConfigurationManager.java   
/**
 * Updates the time and weather for the given player to those of the given world
 */
public void updateTimeAndWeatherForPlayer(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer)
{
    par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet4UpdateTime(par2WorldServer.getTotalWorldTime(), par2WorldServer.getWorldTime(), par2WorldServer.getGameRules().getGameRuleBooleanValue("doDaylightCycle")));

    if (par2WorldServer.isRaining())
    {
        par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(1, 0));
    }
}
项目:forge_world_downloader    文件:WDLNetClientHandler.java   
@Override
public void handleGameEvent(Packet70GameEvent par1Packet70GameEvent)
{
    nch.handleGameEvent(par1Packet70GameEvent);     
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public void func_71033_a(EnumGameType p_71033_1_) {
   this.field_71134_c.func_73076_a(p_71033_1_);
   this.field_71135_a.func_72567_b(new Packet70GameEvent(3, p_71033_1_.func_77148_a()));
}
项目:RuneCraftery    文件:NetHandler.java   
public void func_72488_a(Packet70GameEvent p_72488_1_) {
   this.func_72509_a(p_72488_1_);
}
项目:RuneCraftery    文件:DemoWorldManager.java   
public void updateBlockRemoving()
{
    super.updateBlockRemoving();
    ++this.field_73102_f;
    long i = this.theWorld.getTotalWorldTime();
    long j = i / 24000L + 1L;

    if (!this.field_73105_c && this.field_73102_f > 20)
    {
        this.field_73105_c = true;
        this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 0));
    }

    this.demoTimeExpired = i > 120500L;

    if (this.demoTimeExpired)
    {
        ++this.field_73104_e;
    }

    if (i % 24000L == 500L)
    {
        if (j <= 6L)
        {
            this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day." + j));
        }
    }
    else if (j == 1L)
    {
        if (i == 100L)
        {
            this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 101));
        }
        else if (i == 175L)
        {
            this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 102));
        }
        else if (i == 250L)
        {
            this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 103));
        }
    }
    else if (j == 5L && i % 24000L == 22000L)
    {
        this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day.warning"));
    }
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
/**
 * Sets the player's game mode and sends it to them.
 */
public void setGameType(EnumGameType par1EnumGameType)
{
    this.theItemInWorldManager.setGameType(par1EnumGameType);
    this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(3, par1EnumGameType.getID()));
}
项目: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    文件:DemoWorldManager.java   
public void updateBlockRemoving()
{
    super.updateBlockRemoving();
    ++this.field_73102_f;
    long i = this.theWorld.getTotalWorldTime();
    long j = i / 24000L + 1L;

    if (!this.field_73105_c && this.field_73102_f > 20)
    {
        this.field_73105_c = true;
        this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 0));
    }

    this.demoTimeExpired = i > 120500L;

    if (this.demoTimeExpired)
    {
        ++this.field_73104_e;
    }

    if (i % 24000L == 500L)
    {
        if (j <= 6L)
        {
            this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day." + j));
        }
    }
    else if (j == 1L)
    {
        if (i == 100L)
        {
            this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 101));
        }
        else if (i == 175L)
        {
            this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 102));
        }
        else if (i == 250L)
        {
            this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 103));
        }
    }
    else if (j == 5L && i % 24000L == 22000L)
    {
        this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day.warning"));
    }
}
项目:BetterNutritionMod    文件:EntityPlayerMP.java   
/**
 * Sets the player's game mode and sends it to them.
 */
public void setGameType(EnumGameType par1EnumGameType)
{
    this.theItemInWorldManager.setGameType(par1EnumGameType);
    this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(3, par1EnumGameType.getID()));
}
项目: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);
    }
}