From 5762f11db92a09c83a1556bfeb234f7c792fe98d Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 12 Jan 2025 17:00:01 -0800 Subject: [PATCH] Log skipped entity's position --- .../0267-Log-skipped-entity-s-position.patch | 23 ------------------ .../world/entity/EntityType.java.patch | 24 +++++++++++++++---- 2 files changed, 20 insertions(+), 27 deletions(-) delete mode 100644 patches/server/0267-Log-skipped-entity-s-position.patch diff --git a/patches/server/0267-Log-skipped-entity-s-position.patch b/patches/server/0267-Log-skipped-entity-s-position.patch deleted file mode 100644 index 03d216b91..000000000 --- a/patches/server/0267-Log-skipped-entity-s-position.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: BillyGalbreath -Date: Thu, 24 Nov 2022 11:00:37 -0600 -Subject: [PATCH] Log skipped entity's position - - -diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java -index 20a7fe2995db717f394fc3041435a95dbfee2ff7..2203410d3eac6362e949315b0ec15c270bdb5cb8 100644 ---- a/net/minecraft/world/entity/EntityType.java -+++ b/net/minecraft/world/entity/EntityType.java -@@ -692,6 +692,12 @@ public class EntityType implements FeatureElement, EntityTypeT - entity.load(nbt); - }, () -> { - EntityType.LOGGER.warn("Skipping Entity with id {}", nbt.getString("id")); -+ // Purpur start - log skipped entity's position -+ try { -+ ListTag pos = nbt.getList("Pos", 6); -+ EntityType.LOGGER.warn("Location: {} {},{},{}", world.getWorld().getName(), pos.getDouble(0), pos.getDouble(1), pos.getDouble(2)); -+ } catch (Throwable ignore) {} -+ // Purpur end - }); - } - diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntityType.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntityType.java.patch index 931b71813..6b937ec99 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntityType.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/entity/EntityType.java.patch @@ -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 + ); + } +