aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0298-Prevent-Enderman-from-loading-chunks.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2022-09-01 09:51:59 -0700
committerGitHub <[email protected]>2022-09-01 09:51:59 -0700
commit046466f3ba72d6bdaa0213cde64676dd0024ace0 (patch)
tree717d69c8521cac0e4881c009e636891e116c2378 /patches/server/0298-Prevent-Enderman-from-loading-chunks.patch
parenteff22eb0541559f05cf9a8c370d70c3b346f80f6 (diff)
downloadPaper-046466f3ba72d6bdaa0213cde64676dd0024ace0.tar.gz
Paper-046466f3ba72d6bdaa0213cde64676dd0024ace0.zip
Re-arrange most chunk system patches to front (#8338)
* Re-arrange most chunk system patches to front Co-authored-by: Spottedleaf <[email protected]>
Diffstat (limited to 'patches/server/0298-Prevent-Enderman-from-loading-chunks.patch')
-rw-r--r--patches/server/0298-Prevent-Enderman-from-loading-chunks.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/patches/server/0298-Prevent-Enderman-from-loading-chunks.patch b/patches/server/0298-Prevent-Enderman-from-loading-chunks.patch
new file mode 100644
index 0000000000..0eadb94123
--- /dev/null
+++ b/patches/server/0298-Prevent-Enderman-from-loading-chunks.patch
@@ -0,0 +1,30 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Shane Freeder <[email protected]>
+Date: Tue, 18 Dec 2018 02:15:08 +0000
+Subject: [PATCH] Prevent Enderman from loading chunks
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+index 78a8e5905759d975bb4941b5416fb95ea8c74df5..e0e32528ed9f2f494b5ee2079c3167021f2e84c4 100644
+--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
++++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+@@ -493,7 +493,8 @@ public class EnderMan extends Monster implements NeutralMob {
+ int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 2.0D);
+ int k = Mth.floor(this.enderman.getZ() - 1.0D + randomsource.nextDouble() * 2.0D);
+ BlockPos blockposition = new BlockPos(i, j, k);
+- BlockState iblockdata = world.getBlockState(blockposition);
++ BlockState iblockdata = world.getBlockStateIfLoaded(blockposition); // Paper
++ if (iblockdata == null) return; // Paper
+ BlockPos blockposition1 = blockposition.below();
+ BlockState iblockdata1 = world.getBlockState(blockposition1);
+ BlockState iblockdata2 = this.enderman.getCarriedBlock();
+@@ -539,7 +540,8 @@ public class EnderMan extends Monster implements NeutralMob {
+ int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 3.0D);
+ int k = Mth.floor(this.enderman.getZ() - 2.0D + randomsource.nextDouble() * 4.0D);
+ BlockPos blockposition = new BlockPos(i, j, k);
+- BlockState iblockdata = world.getBlockState(blockposition);
++ BlockState iblockdata = world.getBlockStateIfLoaded(blockposition); // Paper
++ if (iblockdata == null) return; // Paper
+ Vec3 vec3d = new Vec3((double) this.enderman.getBlockX() + 0.5D, (double) j + 0.5D, (double) this.enderman.getBlockZ() + 0.5D);
+ Vec3 vec3d1 = new Vec3((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D);
+ BlockHitResult movingobjectpositionblock = world.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, this.enderman));