From 2bd65f6423c67be85a1fe4c65e96287ac74ba32d Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 19 Dec 2019 16:58:00 +0000 Subject: [PATCH] Update LegacyMapper.java --- .../com/sk89q/worldedit/world/registry/LegacyMapper.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java index f4af74483..9b208e18e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/LegacyMapper.java @@ -142,9 +142,11 @@ public final class LegacyMapper { stringToBlockMap.put(id, blockState); } } - blockArr[combinedId] = blockState.getInternalId(); - blockStateToLegacyId4Data.put(blockState.getInternalId(), (Integer) combinedId); - blockStateToLegacyId4Data.putIfAbsent(blockState.getInternalBlockTypeId(), combinedId); + if (blockState != null) { + blockArr[combinedId] = blockState.getInternalId(); + blockStateToLegacyId4Data.put(blockState.getInternalId(), (Integer) combinedId); + blockStateToLegacyId4Data.putIfAbsent(blockState.getInternalBlockTypeId(), combinedId); + } } for (int id = 0; id < 256; id++) { int combinedId = id << 4;