From 3fef71db2ed4c95f4042028e7d2dfe1fe676b531 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 17 Mar 2024 20:41:00 +0100 Subject: [PATCH] Added missing null checks for CONTAINER_LOOT handler --- .../rewriter/StructuredDataConverter.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/StructuredDataConverter.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/StructuredDataConverter.java index 5f22409fe..b34dbde13 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/StructuredDataConverter.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/StructuredDataConverter.java @@ -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) {