Added missing null checks for CONTAINER_LOOT handler

This commit is contained in:
FlorianMichael 2024-03-17 20:41:00 +01:00 committed by Nassim Jahnke
parent 9ca02680c8
commit 3fef71db2e
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
1 changed files with 8 additions and 2 deletions

View File

@ -278,8 +278,14 @@ final class StructuredDataConverter {
tag.put("BlockEntityTag", data);
});
register(StructuredDataKey.CONTAINER_LOOT, (data, tag) -> {
tag.put("LootTable", data.get("loot_table"));
tag.put("LootTableSeed", data.get("loot_table_seed"));
final Tag lootTable = data.get("loot_table");
if (lootTable != null) {
tag.put("LootTable", lootTable);
}
final Tag lootTableSeed = data.get("loot_table_seed");
if (lootTableSeed != null) {
tag.put("LootTableSeed", lootTableSeed);
}
});
register(StructuredDataKey.ENCHANTMENT_GLINT_OVERRIDE, (data, tag) -> {
if (!data) {