Let invalid positioned entities clean up previous chunk by the chunkCheck
I had did a few of the operations myself, which would have broken chunkCheck from doing it itself, which would leave some state left in the original chunk and thats not good....
This commit is contained in:
parent
92d2907d14
commit
bdcc31caad
9 changed files with 32 additions and 35 deletions
|
@ -1,4 +1,4 @@
|
|||
From 3c6d8305c8007d43baa346e7509fa87793f59c1d Mon Sep 17 00:00:00 2001
|
||||
From ac56ad751d4d82d4212eabc7f6dcdbc47b857bb7 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 26 Jul 2018 00:11:12 -0400
|
||||
Subject: [PATCH] Prevent Saving Bad entities to chunks
|
||||
|
@ -80,7 +80,7 @@ index 4af5a230b..83bcef7e6 100644
|
|||
public static ChunkStatus.Type a(@Nullable NBTTagCompound nbttagcompound) {
|
||||
if (nbttagcompound != null) {
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 6ce7f77a5..1adabb751 100644
|
||||
index 6ce7f77a5..87762b172 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -1085,6 +1085,7 @@ public class WorldServer extends World {
|
||||
|
@ -91,16 +91,13 @@ index 6ce7f77a5..1adabb751 100644
|
|||
for (int j = 0; j < i; ++j) {
|
||||
List<Entity> entityslice = aentityslice[j]; // Spigot
|
||||
Iterator iterator = entityslice.iterator();
|
||||
@@ -1109,11 +1110,28 @@ public class WorldServer extends World {
|
||||
@@ -1109,11 +1110,25 @@ public class WorldServer extends World {
|
||||
throw (IllegalStateException) SystemUtils.c(new IllegalStateException("Removing entity while ticking!"));
|
||||
}
|
||||
|
||||
+ // Paper start - move out entities that shouldn't be in this chunk before it unloads
|
||||
+ if (!entity.dead && (int) Math.floor(entity.locX()) >> 4 != chunk.getPos().x || (int) Math.floor(entity.locZ()) >> 4 != chunk.getPos().z) {
|
||||
+ toMoveChunks.add(entity);
|
||||
+ entity.inChunk = false;
|
||||
+ entity.entitySlice = null;
|
||||
+ iterator.remove();
|
||||
+ continue;
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From d74308ea9718ce70c654463ae2cbc74e8dbad111 Mon Sep 17 00:00:00 2001
|
||||
From b272e3ed56fcdff15a2ffd879ea937079936102e Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 28 Jul 2018 12:18:27 -0400
|
||||
Subject: [PATCH] Ignore Dead Entities in entityList iteration
|
||||
|
@ -63,7 +63,7 @@ index 356de07da..33cd7f7b4 100644
|
|||
public float getBukkitYaw() {
|
||||
return this.yaw;
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 1adabb751..56de91008 100644
|
||||
index 87762b172..8d292604c 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -908,7 +908,7 @@ public class WorldServer extends World {
|
||||
|
@ -75,7 +75,7 @@ index 1adabb751..56de91008 100644
|
|||
if (entity instanceof EntityInsentient) {
|
||||
EntityInsentient entityinsentient = (EntityInsentient) entity;
|
||||
|
||||
@@ -1247,6 +1247,7 @@ public class WorldServer extends World {
|
||||
@@ -1244,6 +1244,7 @@ public class WorldServer extends World {
|
||||
entity.origin = entity.getBukkitEntity().getLocation();
|
||||
}
|
||||
// Paper end
|
||||
|
@ -83,7 +83,7 @@ index 1adabb751..56de91008 100644
|
|||
new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid
|
||||
}
|
||||
|
||||
@@ -1259,6 +1260,7 @@ public class WorldServer extends World {
|
||||
@@ -1256,6 +1257,7 @@ public class WorldServer extends World {
|
||||
this.removeEntityFromChunk(entity);
|
||||
this.entitiesById.remove(entity.getId());
|
||||
this.unregisterEntity(entity);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 902e2759616eb41c26ad90bc2efd0358719e4338 Mon Sep 17 00:00:00 2001
|
||||
From 8664a8652bac4d62e50a42117d2f61c4caa5ece8 Mon Sep 17 00:00:00 2001
|
||||
From: Mystiflow <mystiflow@gmail.com>
|
||||
Date: Fri, 6 Jul 2018 13:21:30 +0100
|
||||
Subject: [PATCH] Send nearby packets from world player list not server list
|
||||
|
@ -46,10 +46,10 @@ index 442673b13..36d31d271 100644
|
|||
double d5 = d1 - entityplayer.locY();
|
||||
double d6 = d2 - entityplayer.locZ();
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 56de91008..3f74a34d8 100644
|
||||
index 8d292604c..09176e604 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -1293,7 +1293,7 @@ public class WorldServer extends World {
|
||||
@@ -1290,7 +1290,7 @@ public class WorldServer extends World {
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.globalEntityList.add(entitylightning);
|
||||
|
@ -58,7 +58,7 @@ index 56de91008..3f74a34d8 100644
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -1425,7 +1425,7 @@ public class WorldServer extends World {
|
||||
@@ -1422,7 +1422,7 @@ public class WorldServer extends World {
|
||||
BlockActionData blockactiondata = (BlockActionData) this.I.removeFirst();
|
||||
|
||||
if (this.a(blockactiondata)) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 04983f017e812190f1de29ef50612ee72715fe65 Mon Sep 17 00:00:00 2001
|
||||
From 7aa6bb5c04a2ef405ebf63c82a6fc3e1e5698227 Mon Sep 17 00:00:00 2001
|
||||
From: Trigary <trigary0@gmail.com>
|
||||
Date: Fri, 14 Sep 2018 17:42:08 +0200
|
||||
Subject: [PATCH] Limit lightning strike effect distance
|
||||
|
@ -69,10 +69,10 @@ index 7c518983a..bdb534deb 100644
|
|||
|
||||
--this.lifeTicks;
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 3f74a34d8..577043c74 100644
|
||||
index 09176e604..43565dd92 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -1293,7 +1293,7 @@ public class WorldServer extends World {
|
||||
@@ -1290,7 +1290,7 @@ public class WorldServer extends World {
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.globalEntityList.add(entitylightning);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 3d4c6a9cd4766057fcd6db19f504cba07be956f2 Mon Sep 17 00:00:00 2001
|
||||
From 0539b98a44e4593da8c672e58037072c528f4b33 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 13 Sep 2014 23:14:43 -0400
|
||||
Subject: [PATCH] Configurable Keep Spawn Loaded range per world
|
||||
|
@ -114,10 +114,10 @@ index 3868572ae..ae77805f7 100644
|
|||
@Override
|
||||
public void a(ChunkCoordIntPair chunkcoordintpair) {
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index fa7709122..0cba585cf 100644
|
||||
index f9ee9afe3..f9c14b9a9 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -1601,13 +1601,85 @@ public class WorldServer extends World {
|
||||
@@ -1598,13 +1598,85 @@ public class WorldServer extends World {
|
||||
return ((PersistentIdCounts) this.getMinecraftServer().getWorldServer(DimensionManager.OVERWORLD).getWorldPersistentData().a(PersistentIdCounts::new, "idcounts")).a();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
From 76bab2d2d7f1f05de240733c82fab37dbc60d0e6 Mon Sep 17 00:00:00 2001
|
||||
From 4017cfdb78a0758a5b0310724c0d3eab3be0cc99 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Sun, 28 Jul 2019 00:51:11 +0100
|
||||
Subject: [PATCH] Mark entities as being ticked when notifying navigation
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 2287453b7..4ddd8fd04 100644
|
||||
index 00379f0a6..a79ccad0b 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -1415,6 +1415,7 @@ public class WorldServer extends World {
|
||||
@@ -1412,6 +1412,7 @@ public class WorldServer extends World {
|
||||
VoxelShape voxelshape1 = iblockdata1.getCollisionShape(this, blockposition);
|
||||
|
||||
if (VoxelShapes.c(voxelshape, voxelshape1, OperatorBoolean.NOT_SAME)) {
|
||||
|
@ -16,7 +16,7 @@ index 2287453b7..4ddd8fd04 100644
|
|||
Iterator iterator = this.navigators.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1425,6 +1426,7 @@ public class WorldServer extends World {
|
||||
@@ -1422,6 +1423,7 @@ public class WorldServer extends World {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From c28915808450a2ec9173915f0f47a0cebcbbe6a5 Mon Sep 17 00:00:00 2001
|
||||
From 175f1aa581f5c3bd0f35201fcf5a5429da491b8a Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 29 Mar 2020 18:26:14 -0400
|
||||
Subject: [PATCH] Ensure Entity is never double registered
|
||||
|
@ -23,7 +23,7 @@ index 16f2e32d2..9cb4e5a1e 100644
|
|||
private boolean locked = false;
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 5b644db97..ed6599ca1 100644
|
||||
index 779da0650..a4f34293f 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -520,6 +520,7 @@ public class WorldServer extends World {
|
||||
|
@ -34,7 +34,7 @@ index 5b644db97..ed6599ca1 100644
|
|||
this.registerEntity(entity);
|
||||
}
|
||||
} // Paper - timings
|
||||
@@ -1347,6 +1348,19 @@ public class WorldServer extends World {
|
||||
@@ -1344,6 +1345,19 @@ public class WorldServer extends World {
|
||||
|
||||
public void unregisterEntity(Entity entity) {
|
||||
org.spigotmc.AsyncCatcher.catchOp("entity unregister"); // Spigot
|
||||
|
@ -54,7 +54,7 @@ index 5b644db97..ed6599ca1 100644
|
|||
// Spigot start
|
||||
if ( entity instanceof EntityHuman )
|
||||
{
|
||||
@@ -1408,9 +1422,21 @@ public class WorldServer extends World {
|
||||
@@ -1405,9 +1419,21 @@ public class WorldServer extends World {
|
||||
|
||||
private void registerEntity(Entity entity) {
|
||||
org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 276cdbbff63e0ee0671b2f0a53178fca15e81647 Mon Sep 17 00:00:00 2001
|
||||
From 98db760202074db2a46203553e963cc97f3a4d1e Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 31 Mar 2020 03:01:45 -0400
|
||||
Subject: [PATCH] Fix unregistering entities from unloading chunks
|
||||
|
@ -15,10 +15,10 @@ Combine that with a buggy detail of the previous implementation of
|
|||
the Dupe UUID patch, then this was the likely source of the "Ghost entities"
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index ed6599ca1..ce1075e5a 100644
|
||||
index a4f34293f..22e8eca96 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -1501,9 +1501,9 @@ public class WorldServer extends World {
|
||||
@@ -1498,9 +1498,9 @@ public class WorldServer extends World {
|
||||
}
|
||||
|
||||
private void removeEntityFromChunk(Entity entity) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 27cdad7a9321efaa5dc7ee8897bbf22086106b2d Mon Sep 17 00:00:00 2001
|
||||
From 2a83e08228511b66dd7351982268256bdc40ef46 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 2 Apr 2020 01:42:39 -0400
|
||||
Subject: [PATCH] Prevent Double PlayerChunkMap adds crashing server
|
||||
|
@ -26,10 +26,10 @@ index 0186ab9e4..e1e4ea793 100644
|
|||
if (!(entity instanceof EntityLightning)) {
|
||||
EntityTypes<?> entitytypes = entity.getEntityType();
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index ce1075e5a..6a5520ee2 100644
|
||||
index 22e8eca96..1f97e3f23 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -1467,7 +1467,7 @@ public class WorldServer extends World {
|
||||
@@ -1464,7 +1464,7 @@ public class WorldServer extends World {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ index ce1075e5a..6a5520ee2 100644
|
|||
// CraftBukkit start - SPIGOT-5278
|
||||
if (entity instanceof EntityDrowned) {
|
||||
this.navigators.add(((EntityDrowned) entity).navigationWater);
|
||||
@@ -1478,6 +1478,7 @@ public class WorldServer extends World {
|
||||
@@ -1475,6 +1475,7 @@ public class WorldServer extends World {
|
||||
this.navigators.add(((EntityInsentient) entity).getNavigation());
|
||||
}
|
||||
entity.valid = true; // CraftBukkit
|
||||
|
|
Loading…
Reference in a new issue