Commits

md_5 authored e339edc403d
Rebuild patches to fix decompilation of certain nested loops
No tags

CraftBukkit-Patches/0008-Spigot-Timings.patch

Modified
1 -From e4e1bd97faead9df4b0da4c133f22cd114d5d7fa Mon Sep 17 00:00:00 2001
1 +From dbd0fd7b7f7255443cae28b0ed64f95f5a8af76c Mon Sep 17 00:00:00 2001
2 2 From: Aikar <aikar@aikar.co>
3 3 Date: Thu, 10 Jan 2013 00:18:11 -0500
4 4 Subject: [PATCH] Spigot Timings
5 5
6 6 Overhauls the Timings System adding performance tracking all around the Minecraft Server
7 7
8 8 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
9 9 index b2a556f60..a1a7cba6e 100644
10 10 --- a/src/main/java/net/minecraft/server/MinecraftServer.java
11 11 +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
270 270
271 271 @@ -862,6 +872,7 @@ public class WorldServer extends World implements ServerEntityGetter, GeneratorA
272 272 for (Entity entity1 : entity.getPassengers()) {
273 273 this.tickPassenger(entity, entity1);
274 274 }
275 275 + entity.tickTimer.stopTiming(); // Spigot
276 276
277 277 }
278 278
279 279 diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
280 -index b95d29a28..0c8ffcd12 100644
280 +index 6ba2871eb..0819474b6 100644
281 281 --- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
282 282 +++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
283 283 @@ -353,6 +353,7 @@ public class PlayerConnection extends ServerCommonPacketListenerImpl implements
284 284
285 285 @Override
286 286 public void tick() {
287 287 + org.bukkit.craftbukkit.SpigotTimings.playerConnectionTimer.startTiming(); // Spigot
288 288 if (this.ackBlockChangesUpTo > -1) {
289 289 this.send(new ClientboundBlockChangedAckPacket(this.ackBlockChangesUpTo));
290 290 this.ackBlockChangesUpTo = -1;
315 315 @@ -2270,6 +2274,8 @@ public class PlayerConnection extends ServerCommonPacketListenerImpl implements
316 316 player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command");
317 317 java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
318 318 return;
319 319 + } finally {
320 320 + org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot
321 321 }
322 322 }
323 323 // CraftBukkit end
324 324 diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
325 -index 452861af7..9c78b7d2c 100644
325 +index 26d92a2ef..111869fce 100644
326 326 --- a/src/main/java/net/minecraft/world/entity/Entity.java
327 327 +++ b/src/main/java/net/minecraft/world/entity/Entity.java
328 328 @@ -156,6 +156,7 @@ import org.bukkit.command.CommandSender;
329 329 import org.bukkit.entity.Hanging;
330 330 import org.bukkit.entity.LivingEntity;
331 331 import org.bukkit.entity.Vehicle;
332 332 +import org.spigotmc.CustomTimingsHandler; // Spigot
333 333 import org.bukkit.event.entity.EntityCombustByEntityEvent;
334 334 import org.bukkit.event.hanging.HangingBreakByEntityEvent;
335 335 import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
351 351 } else {
352 352 @@ -993,6 +996,7 @@ public abstract class Entity implements SyncedDataHolder, INamableTileEntity, En
353 353 gameprofilerfiller.pop();
354 354 }
355 355 }
356 356 + org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot
357 357 }
358 358
359 359 private void applyMovementEmissionAndPlaySound(Entity.MovementEmission entity_movementemission, Vec3D vec3d, BlockPosition blockposition, IBlockData iblockdata) {
360 360 diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
361 -index 1fb92b185..8d8cf895b 100644
361 +index 4fed9669c..8dc1f4333 100644
362 362 --- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
363 363 +++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
364 364 @@ -164,6 +164,8 @@ import org.bukkit.event.player.PlayerDropItemEvent;
365 365 import org.bukkit.event.player.PlayerItemConsumeEvent;
366 366 // CraftBukkit end
367 367
368 368 +import org.bukkit.craftbukkit.SpigotTimings; // Spigot
369 369 +
370 370 public abstract class EntityLiving extends Entity implements Attackable {
371 371
405 405 if (this.isImmobile()) {
406 406 this.jumping = false;
407 407 @@ -3449,6 +3456,7 @@ public abstract class EntityLiving extends Entity implements Attackable {
408 408 this.serverAiStep();
409 409 gameprofilerfiller.pop();
410 410 }
411 411 + SpigotTimings.timerEntityAI.stopTiming(); // Spigot
412 412
413 413 gameprofilerfiller.pop();
414 414 gameprofilerfiller.push("jump");
415 -@@ -3489,6 +3497,7 @@ public abstract class EntityLiving extends Entity implements Attackable {
415 +@@ -3493,6 +3501,7 @@ public abstract class EntityLiving extends Entity implements Attackable {
416 416 this.resetFallDistance();
417 417 }
418 418
419 419 + SpigotTimings.timerEntityAIMove.startTiming(); // Spigot
420 420 label122:
421 421 {
422 422 EntityLiving entityliving = this.getControllingPassenger();
423 -@@ -3504,6 +3513,7 @@ public abstract class EntityLiving extends Entity implements Attackable {
423 +@@ -3508,6 +3517,7 @@ public abstract class EntityLiving extends Entity implements Attackable {
424 424 this.travel(vec3d1);
425 425 }
426 426 }
427 427 + SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot
428 428
429 429 if (!this.level().isClientSide() || this.isLocalInstanceAuthoritative()) {
430 430 this.applyEffectsFromBlocks();
431 -@@ -3537,7 +3547,9 @@ public abstract class EntityLiving extends Entity implements Attackable {
431 +@@ -3541,7 +3551,9 @@ public abstract class EntityLiving extends Entity implements Attackable {
432 432 this.checkAutoSpinAttack(axisalignedbb, this.getBoundingBox());
433 433 }
434 434
435 435 + SpigotTimings.timerEntityAICollision.startTiming(); // Spigot
436 436 this.pushEntities();
437 437 + SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
438 438 gameprofilerfiller.pop();
439 439 world = this.level();
440 440 if (world instanceof WorldServer worldserver1) {
441 441 diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/main/java/net/minecraft/world/level/SpawnerCreature.java

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut