2020-03-21 17:29:35 +01:00
|
|
|
From 979580a2ffb58f7903fbddf2ef26203797535c79 Mon Sep 17 00:00:00 2001
|
2020-02-26 20:12:29 +01:00
|
|
|
From: chickeneer <emcchickeneer@gmail.com>
|
|
|
|
Date: Wed, 22 Jan 2020 01:22:34 -0600
|
|
|
|
Subject: [PATCH] EMC Do not save entities with player passengers
|
|
|
|
|
|
|
|
---
|
|
|
|
.../net/minecraft/server/ChunkRegionLoader.java | 16 +++++++++++++++-
|
|
|
|
1 file changed, 15 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
2020-03-21 17:29:35 +01:00
|
|
|
index d529b795..1b2b73b8 100644
|
2020-02-26 20:12:29 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
2020-03-21 17:29:35 +01:00
|
|
|
@@ -452,7 +452,7 @@ public class ChunkRegionLoader {
|
2020-02-26 20:12:29 +01:00
|
|
|
if (asyncsavedata == null) toUpdate.add(entity); // todo fix this broken code, entityJoinedWorld wont work in this case!
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
- if (asyncsavedata == null && entity.dead) { // todo
|
|
|
|
+ if (asyncsavedata == null && (entity.dead || hasPlayerPassenger(entity))) { // todo // Paper - Add hasPlayerPassenger continue
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
// Paper end
|
2020-03-21 17:29:35 +01:00
|
|
|
@@ -533,6 +533,20 @@ public class ChunkRegionLoader {
|
2020-02-26 20:12:29 +01:00
|
|
|
return nbttagcompound;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
+ private static boolean hasPlayerPassenger(Entity entity) {
|
|
|
|
+ for (Entity passenger : entity.passengers) {
|
|
|
|
+ if (passenger instanceof EntityPlayer) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ if (hasPlayerPassenger(passenger)) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
// Paper start
|
|
|
|
public static ChunkStatus getStatus(NBTTagCompound compound) {
|
|
|
|
if (compound == null) {
|
|
|
|
--
|
|
|
|
2.25.1.windows.1
|
|
|
|
|