2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-12-18 03:20:03 +01:00
|
|
|
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/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
2020-11-09 01:09:37 +01:00
|
|
|
index d03c0b4ea5fad793a7bedad5ae3be0b779dc458c..03176e83ae31aff4c2c75702e249afaef3240f50 100644
|
2018-12-18 03:20:03 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
2020-08-25 04:22:08 +02:00
|
|
|
@@ -380,7 +380,8 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
2019-12-12 17:20:43 +01:00
|
|
|
int j = MathHelper.floor(this.enderman.locY() + random.nextDouble() * 3.0D);
|
|
|
|
int k = MathHelper.floor(this.enderman.locZ() - 2.0D + random.nextDouble() * 4.0D);
|
2018-12-18 03:20:03 +01:00
|
|
|
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();
|
2019-12-12 17:20:43 +01:00
|
|
|
Vec3D vec3d = new Vec3D((double) MathHelper.floor(this.enderman.locX()) + 0.5D, (double) j + 0.5D, (double) MathHelper.floor(this.enderman.locZ()) + 0.5D);
|
2019-05-05 19:19:34 +02:00
|
|
|
Vec3D vec3d1 = new Vec3D((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D);
|
2020-08-25 04:22:08 +02:00
|
|
|
@@ -420,7 +421,8 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
2019-12-12 17:20:43 +01:00
|
|
|
int j = MathHelper.floor(this.a.locY() + random.nextDouble() * 2.0D);
|
|
|
|
int k = MathHelper.floor(this.a.locZ() - 1.0D + random.nextDouble() * 2.0D);
|
2018-12-18 03:20:03 +01:00
|
|
|
BlockPosition blockposition = new BlockPosition(i, j, k);
|
|
|
|
- IBlockData iblockdata = world.getType(blockposition);
|
|
|
|
+ IBlockData iblockdata = world.getTypeIfLoaded(blockposition); // Paper
|
|
|
|
+ if (iblockdata == null) return; // Paper
|
2019-05-05 19:19:34 +02:00
|
|
|
BlockPosition blockposition1 = blockposition.down();
|
|
|
|
IBlockData iblockdata1 = world.getType(blockposition1);
|
2020-08-25 04:22:08 +02:00
|
|
|
IBlockData iblockdata2 = this.a.getCarried();
|