From 68cdc4fa90633207b458bfdbe621b22f2db6d85a Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 18 Apr 2016 09:40:58 -0500 Subject: [PATCH] Remove non-zero BlockIterator block and Loading chunks earlier in player TP patches Allowing only non-zero BlockIterators breaks an API contract explicitly allowing them (*eyeroll*) And loading chunks earlier in the TP patch did not resolve the original issue, and now that it is resolved, shouldn't actually provide any tangible benefits --- ...-non-zero-maxDistance-BlockIterators.patch | 23 ---------------- ...08-Load-chunk-before-player-teleport.patch | 27 ------------------- 2 files changed, 50 deletions(-) delete mode 100644 Spigot-API-Patches/0036-Only-allow-non-zero-maxDistance-BlockIterators.patch delete mode 100644 Spigot-Server-Patches/0108-Load-chunk-before-player-teleport.patch diff --git a/Spigot-API-Patches/0036-Only-allow-non-zero-maxDistance-BlockIterators.patch b/Spigot-API-Patches/0036-Only-allow-non-zero-maxDistance-BlockIterators.patch deleted file mode 100644 index 15def6ba09..0000000000 --- a/Spigot-API-Patches/0036-Only-allow-non-zero-maxDistance-BlockIterators.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 74c1e1dfd8eaaa86e68838b823ebd5177f007066 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Tue, 12 Apr 2016 23:06:56 -0500 -Subject: [PATCH] Only allow non-zero maxDistance BlockIterators - -They can iterate infinitely causing the server to hang. -Fix your plugins! - -diff --git a/src/main/java/org/bukkit/util/BlockIterator.java b/src/main/java/org/bukkit/util/BlockIterator.java -index 5c85778..0f34c66 100644 ---- a/src/main/java/org/bukkit/util/BlockIterator.java -+++ b/src/main/java/org/bukkit/util/BlockIterator.java -@@ -52,6 +52,7 @@ public class BlockIterator implements Iterator { - * - */ - public BlockIterator(World world, Vector start, Vector direction, double yOffset, int maxDistance) { -+ com.google.common.base.Preconditions.checkArgument(maxDistance != 0, "maxDistance cannot be 0!"); // Paper - Only allow non-zero maxDistance - this.world = world; - this.maxDistance = maxDistance; - --- -2.8.0 - diff --git a/Spigot-Server-Patches/0108-Load-chunk-before-player-teleport.patch b/Spigot-Server-Patches/0108-Load-chunk-before-player-teleport.patch deleted file mode 100644 index 21c8c632db..0000000000 --- a/Spigot-Server-Patches/0108-Load-chunk-before-player-teleport.patch +++ /dev/null @@ -1,27 +0,0 @@ -From dc5551d29ec825888b85dbe989d28817473fc1bd Mon Sep 17 00:00:00 2001 -From: Gabscap -Date: Sat, 26 Mar 2016 18:41:22 +0100 -Subject: [PATCH] Load chunk before player teleport - - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index eb88228..0a3dc16 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -554,6 +554,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - getHandle().closeInventory(); - } - -+ // Paper start - Load chunk before player teleport -+ org.bukkit.Chunk chunk = to.getChunk(); -+ if (!chunk.isLoaded()) { -+ chunk.load(); -+ } -+ // Paper end -+ - // Check if the fromWorld and toWorld are the same. - if (fromWorld == toWorld) { - entity.playerConnection.teleport(to); --- -2.8.0 -