From 4b15439e03f05fdb5454bd2a24000984e519d6e0 Mon Sep 17 00:00:00 2001 From: wizjany Date: Sat, 25 May 2019 00:35:12 -0400 Subject: [PATCH] Don't attempt to update empty or invalid flower pots. --- .../io/legacycompat/FlowerPotCompatibilityHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/FlowerPotCompatibilityHandler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/FlowerPotCompatibilityHandler.java index df18a95da..92e998f75 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/FlowerPotCompatibilityHandler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/legacycompat/FlowerPotCompatibilityHandler.java @@ -41,6 +41,9 @@ public class FlowerPotCompatibilityHandler implements NBTCompatibilityHandler { Tag item = values.get("Item"); if (item instanceof StringTag) { String id = ((StringTag) item).getValue(); + if (id.isEmpty()) { + return (B) BlockTypes.FLOWER_POT.getDefaultState(); + } int data = 0; Tag dataTag = values.get("Data"); if (dataTag instanceof IntTag) { @@ -75,7 +78,7 @@ public class FlowerPotCompatibilityHandler implements NBTCompatibilityHandler { break; } String plantedName = null; - if (newId == 0) { + if (newId == 0 && id.startsWith("minecraft:")) { plantedName = id.substring(10); } else { BlockState plantedWithData = LegacyMapper.getInstance().getBlockFromLegacy(newId, data);