2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
|
|
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
|
2023-06-21 15:36:14 +02:00
|
|
|
index acd41b474fadee12c571f390b937f455cbe393ad..fd608b1461ef28a5181ed3beb31f356272f8328f 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
2023-03-14 20:24:52 +01:00
|
|
|
@@ -506,7 +506,8 @@ public class EnderMan extends Monster implements NeutralMob {
|
2022-06-08 03:31:24 +02:00
|
|
|
int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 2.0D);
|
|
|
|
int k = Mth.floor(this.enderman.getZ() - 1.0D + randomsource.nextDouble() * 2.0D);
|
2021-06-11 14:02:28 +02:00
|
|
|
BlockPos blockposition = new BlockPos(i, j, k);
|
|
|
|
- BlockState iblockdata = world.getBlockState(blockposition);
|
2021-12-06 00:32:02 +01:00
|
|
|
+ BlockState iblockdata = world.getBlockStateIfLoaded(blockposition); // Paper
|
2021-06-11 14:02:28 +02:00
|
|
|
+ if (iblockdata == null) return; // Paper
|
|
|
|
BlockPos blockposition1 = blockposition.below();
|
|
|
|
BlockState iblockdata1 = world.getBlockState(blockposition1);
|
|
|
|
BlockState iblockdata2 = this.enderman.getCarriedBlock();
|
2023-03-14 20:24:52 +01:00
|
|
|
@@ -552,7 +553,8 @@ public class EnderMan extends Monster implements NeutralMob {
|
2022-06-08 03:31:24 +02:00
|
|
|
int j = Mth.floor(this.enderman.getY() + randomsource.nextDouble() * 3.0D);
|
|
|
|
int k = Mth.floor(this.enderman.getZ() - 2.0D + randomsource.nextDouble() * 4.0D);
|
2021-06-13 10:26:58 +02:00
|
|
|
BlockPos blockposition = new BlockPos(i, j, k);
|
|
|
|
- BlockState iblockdata = world.getBlockState(blockposition);
|
2021-12-06 00:32:02 +01:00
|
|
|
+ BlockState iblockdata = world.getBlockStateIfLoaded(blockposition); // Paper
|
2021-06-13 10:26:58 +02:00
|
|
|
+ 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));
|