Log skipped entity's position

This commit is contained in:
BillyGalbreath
2025-01-12 17:00:01 -08:00
committed by granny
parent 231fdb5e15
commit 5762f11db9
2 changed files with 20 additions and 27 deletions

View File

@@ -17,11 +17,10 @@
public static ResourceLocation getKey(EntityType<?> entityType) {
return BuiltInRegistries.ENTITY_TYPE.getKey(entityType);
}
@@ -1311,6 +_,16 @@
public MobCategory getCategory() {
@@ -1312,6 +_,16 @@
return this.category;
}
+
+ // Purpur start - PlayerSetSpawnerTypeWithEggEvent
+ public String getName() {
+ return BuiltInRegistries.ENTITY_TYPE.getKey(this).getPath();
@@ -31,6 +30,23 @@
+ return getDescription().getString();
+ }
+ // Purpur end - PlayerSetSpawnerTypeWithEggEvent
+
public String getDescriptionId() {
return this.descriptionId;
}
@@ -1370,7 +_,14 @@
entity.load(tag);
},
// Paper end - Don't fire sync event during generation
- () -> LOGGER.warn("Skipping Entity with id {}", tag.getString("id"))
+ // Purpur start - log skipped entity's position
+ () -> {LOGGER.warn("Skipping Entity with id {}", tag.getString("id"));
+ try {
+ ListTag pos = tag.getList("Pos", 6);
+ EntityType.LOGGER.warn("Location: {} {},{},{}", level.getWorld().getName(), pos.getDouble(0), pos.getDouble(1), pos.getDouble(2));
+ } catch (Throwable ignore) {}
+ }
+ // Purpur end - log skipped entity's position
);
}