From b1d34f6180b33db701a7426aa7087549ba981b2a Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 2 Jul 2017 20:54:29 -0500 Subject: [PATCH] Make timings more tolerant of corrupt chunks Fixes GH-744 --- Spigot-API-Patches/0003-Timings-v2.patch | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Spigot-API-Patches/0003-Timings-v2.patch b/Spigot-API-Patches/0003-Timings-v2.patch index d396b0f709..29e1df3bea 100644 --- a/Spigot-API-Patches/0003-Timings-v2.patch +++ b/Spigot-API-Patches/0003-Timings-v2.patch @@ -1,4 +1,4 @@ -From c511dea5f0acfa883e9b0d0c2acd313e3366d01f Mon Sep 17 00:00:00 2001 +From 9abf1bfaba8bf6b87b4d2c652a356b061764391c Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 29 Feb 2016 18:48:17 -0600 Subject: [PATCH] Timings v2 @@ -671,10 +671,10 @@ index 00000000..916b6f9d +} diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java new file mode 100644 -index 00000000..389875b3 +index 00000000..c2c2fb83 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingHistory.java -@@ -0,0 +1,342 @@ +@@ -0,0 +1,352 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -787,10 +787,20 @@ index 00000000..389875b3 + RegionData data = regions.get(new RegionId(chunk.getX(), chunk.getZ())); + + for (Entity entity : chunk.getEntities()) { ++ if (entity == null) { ++ Bukkit.getLogger().warning("Null entity detected in chunk at position x: " + chunk.getX() + ", z: " + chunk.getZ()); ++ continue; ++ } ++ + data.entityCounts.get(entity.getType()).increment(); + } + + for (BlockState tileEntity : chunk.getTileEntities()) { ++ if (tileEntity == null) { ++ Bukkit.getLogger().warning("Null tileentity detected in chunk at position x: " + chunk.getX() + ", z: " + chunk.getZ()); ++ continue; ++ } ++ + data.tileEntityCounts.get(tileEntity.getBlock().getType()).increment(); + } + } @@ -3185,7 +3195,7 @@ index 00000000..5527e7c8 + +} diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java -index cdf838eb..39b275cb 100644 +index 71709126..b886cd82 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -31,7 +31,7 @@ public class SimpleCommandMap implements CommandMap { @@ -3856,5 +3866,5 @@ index 8d982974..7e89b97b 100644 - } } -- -2.13.0.windows.1 +2.13.2.windows.1