From 6d3aabecda3dbefaeba12eab799b27b75b2509f3 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 22 Aug 2018 04:13:42 +1000 Subject: [PATCH] Don't default to air for legacy mapper --- .../com/sk89q/worldedit/world/registry/LegacyMapper.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 f02409495..cb2ecec92 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 @@ -179,7 +179,9 @@ public class LegacyMapper { private BlockState getBlock(int combinedId) { if (combinedId < blockArr.length) { try { - return BlockState.get(blockArr[combinedId]); + int internalId = blockArr[combinedId]; + if (internalId == 0) return null; + return BlockState.get(internalId); } catch (IndexOutOfBoundsException ignore) { return null; } @@ -191,7 +193,7 @@ public class LegacyMapper { if (extra != null) { return BlockState.get(extra); } - return BlockTypes.AIR.getDefaultState(); + return null; } public void register(int id, int data, BlockStateHolder state) {