Paper/Spigot-Server-Patches/0406-Prevent-Enderman-from-loading-chunks.patch
Shane Freeder ea855e2b46 Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Developers!: You will need to clean up your work/Minecraft/1.13.2 folder
for this

Also, restore a patch that was dropped in the last upstream

Bukkit Changes:
279eeab3 Fix command description not being set
96e2bb18 Remove debug print from SyntheticEventTest

CraftBukkit Changes:
d3ed1516 Fix dangerously threaded beacons
217a293d Don't relocate joptsimple to allow --help to work.
1be05a21 Prepare for imminent Java 12 release
a49270b2 Mappings Update
5259d80c SPIGOT-4669: Fix PlayerTeleportEvent coordinates for relative teleports

Spigot Changes:
e6eb36f2 Rebuild patches
2019-03-20 01:55:16 +00:00

34 lines
2.3 KiB
Diff

From f18f9c31dd37e88747b1c19a657bf7878de484ae 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 e4aba0e0a..945040442 100644
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
@@ -297,7 +297,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);
@@ -335,7 +336,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.21.0