/** * Updates the time and weather for the given player to those of the given world */ public void updateTimeAndWeatherForPlayer(EntityPlayerMP playerIn, WorldServer worldIn) { WorldBorder worldborder = this.mcServer.worldServers[0].getWorldBorder(); playerIn.playerNetServerHandler.sendPacket(new S44PacketWorldBorder(worldborder, S44PacketWorldBorder.Action.INITIALIZE)); playerIn.playerNetServerHandler.sendPacket(new S03PacketTimeUpdate(worldIn.getTotalWorldTime(), worldIn.getWorldTime(), worldIn.getGameRules().getBoolean("doDaylightCycle"))); if (worldIn.isRaining()) { playerIn.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F)); playerIn.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, worldIn.getRainStrength(1.0F))); playerIn.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, worldIn.getThunderStrength(1.0F))); } }
@Overwrite public void updateTimeAndWeatherForPlayer(EntityPlayerMP playerIn, WorldServer worldIn) { final WorldBorder worldborder = worldIn.getWorldBorder(); playerIn.playerNetServerHandler.sendPacket(new S44PacketWorldBorder(worldborder, S44PacketWorldBorder.Action.INITIALIZE)); playerIn.playerNetServerHandler.sendPacket(new S03PacketTimeUpdate(worldIn.getTotalWorldTime(), worldIn.getWorldTime(), worldIn.getGameRules().getGameRuleBooleanValue("doDaylightCycle"))); final IMixinWorld world = (IMixinWorld) worldIn; playerIn.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, getRainStrengthValue(world.getRainStrength()))); playerIn.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, getThunderStrengthValue(world.getRainStrength(), world.getDarkness()))); }
/** * Updates the time and weather for the given player to those of the given world */ public void updateTimeAndWeatherForPlayer(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer) { par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S03PacketTimeUpdate(par2WorldServer.getTotalWorldTime(), par2WorldServer.getWorldTime(), par2WorldServer.getGameRules().getGameRuleBooleanValue("doDaylightCycle"))); if (par2WorldServer.isRaining()) { par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F)); par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, par2WorldServer.getRainStrength(1.0F))); par1EntityPlayerMP.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, par2WorldServer.getWeightedThunderStrength(1.0F))); } }
public void updateTimeAndWeatherForPlayer(EntityPlayerMP p_72354_1_, WorldServer p_72354_2_) { p_72354_1_.playerNetServerHandler.sendPacket(new S03PacketTimeUpdate(p_72354_2_.getTotalWorldTime(), p_72354_2_.getWorldTime(), p_72354_2_.getGameRules().getGameRuleBooleanValue("doDaylightCycle"))); if (p_72354_2_.isRaining()) { // CraftBukkit start - handle player weather p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F)); p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, p_72354_2_.getRainStrength(1.0F))); p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, p_72354_2_.getWeightedThunderStrength(1.0F))); p_72354_1_.setPlayerWeather(org.bukkit.WeatherType.DOWNFALL, false); // CraftBukkit end } }
public void updateTimeAndWeatherForPlayer(EntityPlayerMP p_72354_1_, WorldServer p_72354_2_) { p_72354_1_.playerNetServerHandler.sendPacket(new S03PacketTimeUpdate(p_72354_2_.getTotalWorldTime(), p_72354_2_.getWorldTime(), p_72354_2_.getGameRules().getGameRuleBooleanValue("doDaylightCycle"))); if (p_72354_2_.isRaining()) { p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F)); p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, p_72354_2_.getRainStrength(1.0F))); p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, p_72354_2_.getWeightedThunderStrength(1.0F))); } }
public void updateTimeLightAndEntities() { this.theProfiler.startSection("jobs"); synchronized (this.futureTaskQueue) { while (!this.futureTaskQueue.isEmpty()) { Util.func_181617_a((FutureTask)this.futureTaskQueue.poll(), logger); } } this.theProfiler.endStartSection("levels"); for (int j = 0; j < this.worldServers.length; ++j) { long i = System.nanoTime(); if (j == 0 || this.getAllowNether()) { WorldServer worldserver = this.worldServers[j]; this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName()); if (this.tickCounter % 20 == 0) { this.theProfiler.startSection("timeSync"); this.serverConfigManager.sendPacketToAllPlayersInDimension(new S03PacketTimeUpdate(worldserver.getTotalWorldTime(), worldserver.getWorldTime(), worldserver.getGameRules().getBoolean("doDaylightCycle")), worldserver.provider.getDimensionId()); this.theProfiler.endSection(); } this.theProfiler.startSection("tick"); try { worldserver.tick(); } catch (Throwable throwable1) { CrashReport crashreport = CrashReport.makeCrashReport(throwable1, "Exception ticking world"); worldserver.addWorldInfoToCrashReport(crashreport); throw new ReportedException(crashreport); } try { worldserver.updateEntities(); } catch (Throwable throwable) { CrashReport crashreport1 = CrashReport.makeCrashReport(throwable, "Exception ticking world entities"); worldserver.addWorldInfoToCrashReport(crashreport1); throw new ReportedException(crashreport1); } this.theProfiler.endSection(); this.theProfiler.startSection("tracker"); worldserver.getEntityTracker().updateTrackedEntities(); this.theProfiler.endSection(); this.theProfiler.endSection(); } this.timeOfLastDimensionTick[j][this.tickCounter % 100] = System.nanoTime() - i; } this.theProfiler.endStartSection("connection"); this.getNetworkSystem().networkTick(); this.theProfiler.endStartSection("players"); this.serverConfigManager.onTick(); this.theProfiler.endStartSection("tickables"); for (int k = 0; k < this.playersOnline.size(); ++k) { ((ITickable)this.playersOnline.get(k)).update(); } this.theProfiler.endSection(); }
public void handleTimeUpdate(S03PacketTimeUpdate packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); this.gameController.theWorld.setTotalWorldTime(packetIn.getTotalWorldTime()); this.gameController.theWorld.setWorldTime(packetIn.getWorldTime()); }
@EventTarget private void onPacketRecieve(PacketReceiveEvent event) { if (event.packet instanceof S03PacketTimeUpdate) { event.setCancelled(true); } }
@Override public Packet updateTime(long worldAge, long time) { return new NeptunePacket(new S03PacketTimeUpdate(worldAge, time, false)); }
public void handleTimeUpdate(S03PacketTimeUpdate p_147285_1_) { this.gameController.theWorld.func_82738_a(p_147285_1_.func_149366_c()); this.gameController.theWorld.setWorldTime(p_147285_1_.func_149365_d()); }
public void updateTimeLightAndEntities() { this.theProfiler.startSection("levels"); int var1; for (var1 = 0; var1 < this.worldServers.length; ++var1) { long var2 = System.nanoTime(); if (var1 == 0 || this.getAllowNether()) { WorldServer var4 = this.worldServers[var1]; this.theProfiler.startSection(var4.getWorldInfo().getWorldName()); this.theProfiler.startSection("pools"); var4.getWorldVec3Pool().clear(); this.theProfiler.endSection(); if (this.tickCounter % 20 == 0) { this.theProfiler.startSection("timeSync"); this.serverConfigManager.func_148537_a(new S03PacketTimeUpdate(var4.getTotalWorldTime(), var4.getWorldTime(), var4.getGameRules().getGameRuleBooleanValue("doDaylightCycle")), var4.provider.dimensionId); this.theProfiler.endSection(); } this.theProfiler.startSection("tick"); CrashReport var6; try { var4.tick(); } catch (Throwable var8) { var6 = CrashReport.makeCrashReport(var8, "Exception ticking world"); var4.addWorldInfoToCrashReport(var6); throw new ReportedException(var6); } try { var4.updateEntities(); } catch (Throwable var7) { var6 = CrashReport.makeCrashReport(var7, "Exception ticking world entities"); var4.addWorldInfoToCrashReport(var6); throw new ReportedException(var6); } this.theProfiler.endSection(); this.theProfiler.startSection("tracker"); var4.getEntityTracker().updateTrackedEntities(); this.theProfiler.endSection(); this.theProfiler.endSection(); } this.timeOfLastDimensionTick[var1][this.tickCounter % 100] = System.nanoTime() - var2; } this.theProfiler.endStartSection("connection"); this.func_147137_ag().networkTick(); this.theProfiler.endStartSection("players"); this.serverConfigManager.sendPlayerInfoToAllPlayers(); this.theProfiler.endStartSection("tickables"); for (var1 = 0; var1 < this.tickables.size(); ++var1) { ((IUpdatePlayerListBox)this.tickables.get(var1)).update(); } this.theProfiler.endSection(); }
@Override public Packet updateTime(long worldAge, long time) { return (Packet) new S03PacketTimeUpdate(worldAge, time, false); }
public void updateTimeLightAndEntities() { this.theProfiler.startSection("levels"); net.minecraftforge.common.chunkio.ChunkIOExecutor.tick(); int i; Integer[] ids = DimensionManager.getIDs(this.tickCounter % 200 == 0); for (int x = 0; x < ids.length; x++) { int id = ids[x]; long j = System.nanoTime(); if (id == 0 || this.getAllowNether()) { WorldServer worldserver = DimensionManager.getWorld(id); this.theProfiler.startSection(worldserver.getWorldInfo().getWorldName()); this.theProfiler.startSection("pools"); this.theProfiler.endSection(); if (this.tickCounter % 20 == 0) { this.theProfiler.startSection("timeSync"); this.serverConfigManager.sendPacketToAllPlayersInDimension(new S03PacketTimeUpdate(worldserver.getTotalWorldTime(), worldserver.getWorldTime(), worldserver.getGameRules().getGameRuleBooleanValue("doDaylightCycle")), worldserver.provider.dimensionId); this.theProfiler.endSection(); } this.theProfiler.startSection("tick"); FMLCommonHandler.instance().onPreWorldTick(worldserver); CrashReport crashreport; try { worldserver.tick(); } catch (Throwable throwable1) { crashreport = CrashReport.makeCrashReport(throwable1, "Exception ticking world"); worldserver.addWorldInfoToCrashReport(crashreport); throw new ReportedException(crashreport); } try { worldserver.updateEntities(); } catch (Throwable throwable) { crashreport = CrashReport.makeCrashReport(throwable, "Exception ticking world entities"); worldserver.addWorldInfoToCrashReport(crashreport); throw new ReportedException(crashreport); } FMLCommonHandler.instance().onPostWorldTick(worldserver); this.theProfiler.endSection(); this.theProfiler.startSection("tracker"); worldserver.getEntityTracker().updateTrackedEntities(); this.theProfiler.endSection(); this.theProfiler.endSection(); } worldTickTimes.get(id)[this.tickCounter % 100] = System.nanoTime() - j; } this.theProfiler.endStartSection("dim_unloading"); DimensionManager.unloadWorlds(worldTickTimes); this.theProfiler.endStartSection("connection"); this.func_147137_ag().networkTick(); this.theProfiler.endStartSection("players"); this.serverConfigManager.sendPlayerInfoToAllPlayers(); this.theProfiler.endStartSection("tickables"); for (i = 0; i < this.tickables.size(); ++i) { ((IUpdatePlayerListBox)this.tickables.get(i)).update(); } this.theProfiler.endSection(); }
void handleTimeUpdate(S03PacketTimeUpdate packetIn);
void handleTimeUpdate(S03PacketTimeUpdate var1);
void handleTimeUpdate(S03PacketTimeUpdate p_147285_1_);