diff options
-rw-r--r-- | Spigot-Server-Patches/0365-Backport-Prevent-mob-spawning-from-loading-generatin.patch | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Spigot-Server-Patches/0365-Backport-Prevent-mob-spawning-from-loading-generatin.patch b/Spigot-Server-Patches/0365-Backport-Prevent-mob-spawning-from-loading-generatin.patch index b14186c90e..8ab32a6de5 100644 --- a/Spigot-Server-Patches/0365-Backport-Prevent-mob-spawning-from-loading-generatin.patch +++ b/Spigot-Server-Patches/0365-Backport-Prevent-mob-spawning-from-loading-generatin.patch @@ -1,11 +1,11 @@ -From 88153d3b72c888683b63d4d5aa8bcc94cbe5f07a Mon Sep 17 00:00:00 2001 +From 96a29101e4eedaca172aec3ab96c880b9b3e5371 Mon Sep 17 00:00:00 2001 From: Shane Freeder <[email protected]> Date: Mon, 8 Oct 2018 17:51:52 +0100 Subject: [PATCH] Backport: Prevent mob spawning from loading/generating chunks diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 11e69a0547..93ae14e4a5 100644 +index 11e69a0547..5c5bed0344 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -158,9 +158,9 @@ public final class SpawnerCreature { @@ -13,21 +13,22 @@ index 11e69a0547..93ae14e4a5 100644 int j2 = blockposition1.getY(); int k2 = blockposition1.getZ(); - IBlockData iblockdata = worldserver.getType(blockposition1); -+ IBlockData iblockdata = worldserver.getWorldBorder().isInBounds(blockposition1) ? worldserver.getType(blockposition1) : null; // Paper ++ IBlockData iblockdata = worldserver.getWorldBorder().isInBounds(blockposition1) ? worldserver.getTypeIfLoaded(blockposition1) : null; // Paper - if (!iblockdata.l()) { + if (iblockdata != null && !iblockdata.l()) { // Paper int l2 = 0; int i3 = 0; -@@ -184,6 +184,7 @@ public final class SpawnerCreature { +@@ -184,7 +184,7 @@ public final class SpawnerCreature { float f = (float) j3 + 0.5F; float f1 = (float) l3 + 0.5F; -+ if (worldserver.isChunkLoaded(j3, l3, true) && worldserver.getWorldBorder().isInBounds(blockposition_mutableblockposition)) // paper - Prevent mob spawning from loading/generating chunks - if (!worldserver.isPlayerNearby((double) f, (double) k3, (double) f1, 24.0D) && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) { +- if (!worldserver.isPlayerNearby((double) f, (double) k3, (double) f1, 24.0D) && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) { ++ if (worldserver.getWorldBorder().isInBounds(blockposition_mutableblockposition) && worldserver.getChunkIfLoaded(blockposition_mutableblockposition) != null && !worldserver.isPlayerNearby((double) f, (double) k3, (double) f1, 24.0D) && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) { // Paper - Prevent mob spawning from loading/generating chunks if (biomebase_biomemeta == null) { biomebase_biomemeta = worldserver.a(enumcreaturetype, (BlockPosition) blockposition_mutableblockposition); + if (biomebase_biomemeta == null) { -- 2.19.1 |