From 5cd9616507311b70a72e380a48f6b1a8235ad777 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 13 Apr 2023 17:34:16 +0100 Subject: [PATCH] fix: Ensure BaseBlock is not returned when a BlockState is wanted in BlockTransformExtent (#2161 - NBT will be handled appropriately at another point - Fixes #2085 --- .../worldedit/extent/transform/BlockTransformExtent.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java index 8382319c9..f22d7036d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java @@ -555,10 +555,11 @@ public class BlockTransformExtent extends ResettableExtent { int transformedId = transformState(state, transform); BlockState transformed = BlockState.getFromInternalId(transformedId); - if (block.hasNbtData()) { + boolean baseBlock = block instanceof BaseBlock; + if (baseBlock && block.hasNbtData()) { return (B) transformBaseBlockNBT(transformed, block.getNbtData(), transform); } - return (B) (block instanceof BaseBlock ? transformed.toBaseBlock() : transformed); + return (B) (baseBlock? transformed.toBaseBlock() : transformed); //FAWE end }