mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
31 lines
2.2 KiB
Diff
31 lines
2.2 KiB
Diff
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
|
|
index de167655a556a700bdc7d92fa54b802924b2a61a..b27e2e1e2270a7a2f3e36b90a19237e39e4175b8 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
|
@@ -465,7 +465,8 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
int j = Mth.floor(this.enderman.getY() + random.nextDouble() * 2.0D);
|
|
int k = Mth.floor(this.enderman.getZ() - 1.0D + random.nextDouble() * 2.0D);
|
|
BlockPos blockposition = new BlockPos(i, j, k);
|
|
- BlockState iblockdata = world.getBlockState(blockposition);
|
|
+ BlockState iblockdata = world.getTypeIfLoaded(blockposition); // Paper
|
|
+ if (iblockdata == null) return; // Paper
|
|
BlockPos blockposition1 = blockposition.below();
|
|
BlockState iblockdata1 = world.getBlockState(blockposition1);
|
|
BlockState iblockdata2 = this.enderman.getCarriedBlock();
|
|
@@ -511,7 +512,8 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
int j = Mth.floor(this.enderman.getY() + random.nextDouble() * 3.0D);
|
|
int k = Mth.floor(this.enderman.getZ() - 2.0D + random.nextDouble() * 4.0D);
|
|
BlockPos blockposition = new BlockPos(i, j, k);
|
|
- BlockState iblockdata = world.getBlockState(blockposition);
|
|
+ BlockState iblockdata = world.getTypeIfLoaded(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));
|