mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: 9fe63a16 Update to 1.14.4 (#2333)
51 lines
3.0 KiB
Diff
51 lines
3.0 KiB
Diff
From eab5cee2a53339bdf99a85b6f2966b4aa2045381 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Fri, 12 Jul 2019 16:18:55 -0500
|
|
Subject: [PATCH] Prevent entities from loading unloaded chunks
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/Entity.java | 1 +
|
|
src/main/java/net/minecraft/server/EntityEnderman.java | 1 +
|
|
src/main/java/net/minecraft/server/EntityZombie.java | 1 +
|
|
3 files changed, 3 insertions(+)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
|
index 26a30e1c02..cfe21c2e70 100644
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
@@ -577,6 +577,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
int j = MathHelper.floor(this.locY - 0.20000000298023224D);
|
|
int k = MathHelper.floor(this.locZ);
|
|
BlockPosition blockposition = new BlockPosition(i, j, k);
|
|
+ if (!world.isLoaded(blockposition)) return; // Purpur
|
|
IBlockData iblockdata = this.world.getType(blockposition);
|
|
|
|
if (iblockdata.isAir()) {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
index 0939bbd5fb..6c5e10eef0 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
|
@@ -222,6 +222,7 @@ public class EntityEnderman extends EntityMonster {
|
|
|
|
private boolean l(double d0, double d1, double d2) {
|
|
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(d0, d1, d2);
|
|
+ if (!world.isLoaded(blockposition_mutableblockposition)) return false; // Purpur
|
|
|
|
while (blockposition_mutableblockposition.getY() > 0 && !this.world.getType(blockposition_mutableblockposition).getMaterial().isSolid()) {
|
|
blockposition_mutableblockposition.c(EnumDirection.DOWN);
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
index 6fbe1a7817..8fbad4b91b 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
@@ -298,6 +298,7 @@ public class EntityZombie extends EntityMonster {
|
|
int j1 = j + MathHelper.nextInt(this.random, 7, 40) * MathHelper.nextInt(this.random, -1, 1);
|
|
int k1 = k + MathHelper.nextInt(this.random, 7, 40) * MathHelper.nextInt(this.random, -1, 1);
|
|
BlockPosition blockposition = new BlockPosition(i1, j1 - 1, k1);
|
|
+ if (!world.isLoaded(blockposition)) continue; // Purpur
|
|
|
|
if (this.world.getType(blockposition).a((IBlockAccess) this.world, blockposition, (Entity) entityzombie) && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) {
|
|
entityzombie.setPosition((double) i1, (double) j1, (double) k1);
|
|
--
|
|
2.20.1
|
|
|