Add more ResourceLocation checks, some cleanup

This commit is contained in:
Nassim Jahnke
2024-02-18 12:53:27 +01:00
parent 14253bdf2c
commit bc49d1fd6c
5 changed files with 102 additions and 34 deletions

View File

@@ -675,7 +675,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Copied from super with changes, always check the original method
+ this.lootableData.loadNbt(nbt); // Paper
+ if (nbt.contains("LootTable", 8)) {
+ this.setLootTable(new ResourceLocation(nbt.getString("LootTable")));
+ this.setLootTable(ResourceLocation.tryParse(nbt.getString("LootTable")));
+ try { org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(this.lootTable); } catch (IllegalArgumentException ex) { this.lootTable = null; } // Paper - validate
+ this.setLootTableSeed(nbt.getLong("LootTableSeed"));
+ return false; // Paper - always load the items, table may still remain