13
0
geforkt von Mirrors/Paper

SPIGOT-7532: Entity#isValid() returns false after server restart

By: Jishuna <joshl5324@gmail.com>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2023-12-07 08:24:27 +11:00
Ursprung 5690a0ab1f
Commit bf7ca9b824

Datei anzeigen

@ -593,26 +593,16 @@
} }
@Override @Override
@@ -1737,7 +1953,9 @@ @@ -1785,6 +2001,8 @@
a() {}
- public void onCreated(Entity entity) {}
+ public void onCreated(Entity entity) {
+ entity.inWorld = true; // CraftBukkit - Mark entity as in world
+ }
public void onDestroyed(Entity entity) {
WorldServer.this.getScoreboard().entityRemoved(entity);
@@ -1785,6 +2003,7 @@
} }
entity.updateDynamicGameEventListener(DynamicGameEventListener::add); entity.updateDynamicGameEventListener(DynamicGameEventListener::add);
+ entity.inWorld = true; // CraftBukkit - Mark entity as in world
+ entity.valid = true; // CraftBukkit + entity.valid = true; // CraftBukkit
} }
public void onTrackingEnd(Entity entity) { public void onTrackingEnd(Entity entity) {
@@ -1821,6 +2040,14 @@ @@ -1821,6 +2039,14 @@
} }
entity.updateDynamicGameEventListener(DynamicGameEventListener::remove); entity.updateDynamicGameEventListener(DynamicGameEventListener::remove);