mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Combine patches for entities loading unloaded chunks
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
From d7b4dc9f2e73e04b56a0eca20a65adad252801bb 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 b1afdf71bb..79fb1c6c8e 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 f551192a04..eb07bbcd9e 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 9dfddd980b..32144bf92d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
@@ -296,6 +296,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
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
From 45acaf6afc185ca3d39f570cc64f16a12b9b3dfa 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 moving in unloaded chunks
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/Entity.java | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index b1afdf71bb..79fb1c6c8e 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()) {
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
From 82f95c953bafcb85d15d76d08ba32e52fbebac55 Mon Sep 17 00:00:00 2001
|
||||
From 5cf7d07b9b10cc748dbb45549aaea70da5c5c48d Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 14 Jul 2019 19:52:47 -0500
|
||||
Subject: [PATCH] Mending mends most damages equipment first
|
||||
@@ -1,24 +0,0 @@
|
||||
From c5ee4071c9329bf54928f2701a7d7402e56d9b88 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 13 Jul 2019 18:41:37 -0500
|
||||
Subject: [PATCH] Prevent enderman teleporting into unloaded chunks
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityEnderman.java | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
index f551192a04..eb07bbcd9e 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);
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
From 2743ab191c1f49d276cac635ad2c2d1893847ddb Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 13 Jul 2019 18:50:05 -0500
|
||||
Subject: [PATCH] Prevent zombies spawning reinforcements in unloaded chunks
|
||||
|
||||
---
|
||||
src/main/java/net/minecraft/server/EntityZombie.java | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
index 9dfddd980b..32144bf92d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
||||
@@ -296,6 +296,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
|
||||
|
||||
Reference in New Issue
Block a user