From b2f6b9f7ea28f69b27ff1e218aae666d745bbb9b Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 18 Dec 2018 02:20:03 +0000 Subject: [PATCH] Prevent Enderman from loading chunks --- .../0018-Player-affects-spawning-API.patch | 2 +- ...Prevent-Enderman-from-loading-chunks.patch | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 Spigot-Server-Patches/0416-Prevent-Enderman-from-loading-chunks.patch diff --git a/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch b/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch index 7b8a7364aa..4201d32666 100644 --- a/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch +++ b/Spigot-Server-Patches/0018-Player-affects-spawning-API.patch @@ -1,4 +1,4 @@ -From bde91baa8fe7c3bd031f0cff6c602a672a50e71a Mon Sep 17 00:00:00 2001 +From 164c726a9beb2ae4706cee345a93948451828d46 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Tue, 1 Mar 2016 14:47:52 -0600 Subject: [PATCH] Player affects spawning API diff --git a/Spigot-Server-Patches/0416-Prevent-Enderman-from-loading-chunks.patch b/Spigot-Server-Patches/0416-Prevent-Enderman-from-loading-chunks.patch new file mode 100644 index 0000000000..8a83b942a5 --- /dev/null +++ b/Spigot-Server-Patches/0416-Prevent-Enderman-from-loading-chunks.patch @@ -0,0 +1,33 @@ +From dac80403916d0d136afa630b00ee4a56c0bf983f Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Tue, 18 Dec 2018 02:15:08 +0000 +Subject: [PATCH] Prevent Enderman from loading chunks + + +diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java +index 7ef46851e..1df974bc9 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderman.java ++++ b/src/main/java/net/minecraft/server/EntityEnderman.java +@@ -305,7 +305,8 @@ public class EntityEnderman extends EntityMonster { + int j = MathHelper.floor(this.enderman.locY + random.nextDouble() * 3.0D); + int k = MathHelper.floor(this.enderman.locZ - 2.0D + random.nextDouble() * 4.0D); + BlockPosition blockposition = new BlockPosition(i, j, k); +- IBlockData iblockdata = world.getType(blockposition); ++ IBlockData iblockdata = world.getTypeIfLoaded(blockposition); // Paper ++ if (iblockdata == null) return; // Paper + Block block = iblockdata.getBlock(); + MovingObjectPosition movingobjectposition = world.rayTrace(new Vec3D((double) ((float) MathHelper.floor(this.enderman.locX) + 0.5F), (double) ((float) j + 0.5F), (double) ((float) MathHelper.floor(this.enderman.locZ) + 0.5F)), new Vec3D((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F)), FluidCollisionOption.NEVER, true, false); + boolean flag = movingobjectposition != null && movingobjectposition.getBlockPosition().equals(blockposition); +@@ -343,7 +344,8 @@ public class EntityEnderman extends EntityMonster { + int j = MathHelper.floor(this.a.locY + random.nextDouble() * 2.0D); + int k = MathHelper.floor(this.a.locZ - 1.0D + random.nextDouble() * 2.0D); + BlockPosition blockposition = new BlockPosition(i, j, k); +- IBlockData iblockdata = world.getType(blockposition); ++ IBlockData iblockdata = world.getTypeIfLoaded(blockposition); // Paper ++ if (iblockdata == null) return; // Paper + IBlockData iblockdata1 = world.getType(blockposition.down()); + IBlockData iblockdata2 = Block.getValidBlockForPosition(getEnderman().getCarried(), getEnderman().world, blockposition); // Paper - Fix MC-124320 + +-- +2.20.0 +