mirror of
https://github.com/PaperMC/Paper.git
synced 2024-09-12 06:58:11 +02:00
This patch appears to be no longer relevant, and is seemingly a leading cause of datapack performance being horrific
34 lines
2.1 KiB
Diff
34 lines
2.1 KiB
Diff
From 77bf776b67d4dc1ab7143973d3ffc8d27a04d56a 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/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
index d86f76f30..212636dcb 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
@@ -344,7 +344,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();
|
|
Vec3D vec3d = new Vec3D((double) MathHelper.floor(this.enderman.locX()) + 0.5D, (double) j + 0.5D, (double) MathHelper.floor(this.enderman.locZ()) + 0.5D);
|
|
Vec3D vec3d1 = new Vec3D((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D);
|
|
@@ -386,7 +387,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
|
|
BlockPosition blockposition1 = blockposition.down();
|
|
IBlockData iblockdata1 = world.getType(blockposition1);
|
|
IBlockData iblockdata2 = Block.getValidBlockForPosition(getEnderman().getCarried(), getEnderman().world, blockposition); // Paper - Fix MC-124320
|
|
--
|
|
2.25.1
|
|
|