mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 04:02:06 -07:00
Replace spigot check with generation check
This commit is contained in:
@@ -1065,11 +1065,10 @@
|
||||
@Override
|
||||
public CrashReportCategory fillReportDetails(CrashReport report) {
|
||||
CrashReportCategory crashReportCategory = super.fillReportDetails(report);
|
||||
@@ -1712,6 +_,8 @@
|
||||
@@ -1712,6 +_,7 @@
|
||||
final class EntityCallbacks implements LevelCallback<Entity> {
|
||||
@Override
|
||||
public void onCreated(Entity entity) {
|
||||
+ entity.inWorld = true; // CraftBukkit - Mark entity as in world
|
||||
+ entity.setOldPosAndRot(); // Paper - update old pos / rot for new entities as it will default to Vec3.ZERO
|
||||
}
|
||||
|
||||
@@ -1109,10 +1108,11 @@
|
||||
String string = "onTrackingStart called during navigation iteration";
|
||||
Util.logAndPauseIfInIde(
|
||||
"onTrackingStart called during navigation iteration", new IllegalStateException("onTrackingStart called during navigation iteration")
|
||||
@@ -1755,10 +_,51 @@
|
||||
@@ -1755,10 +_,52 @@
|
||||
}
|
||||
|
||||
entity.updateDynamicGameEventListener(DynamicGameEventListener::add);
|
||||
+ entity.inWorld = true; // CraftBukkit - Mark entity as in world
|
||||
+ entity.valid = true; // CraftBukkit
|
||||
+ ServerLevel.this.getChunkSource().addEntity(entity); // Paper - ignore and warn about illegal addEntity calls instead of crashing server
|
||||
+ // Paper start - Entity origin API
|
||||
|
@@ -1961,10 +1961,8 @@ public class CraftEventFactory {
|
||||
return;
|
||||
}
|
||||
|
||||
// SPIGOT-8041: Do not call event unless entity has been spawned into world
|
||||
if (!entity.inWorld) {
|
||||
return;
|
||||
}
|
||||
// Do not call during generation.
|
||||
if (entity.generation) return;
|
||||
|
||||
Bukkit.getPluginManager().callEvent(new EntityRemoveEvent(entity.getBukkitEntity(), cause));
|
||||
}
|
||||
|
Reference in New Issue
Block a user