fix: Ensure BaseBlock is not returned when a BlockState is wanted in BlockTransformExtent (#2161

- NBT will be handled appropriately at another point
 - Fixes #2085
This commit is contained in:
Jordan 2023-04-13 17:34:16 +01:00 committed by GitHub
parent e4158ac084
commit 5cd9616507
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -555,10 +555,11 @@ public class BlockTransformExtent extends ResettableExtent {
int transformedId = transformState(state, transform); int transformedId = transformState(state, transform);
BlockState transformed = BlockState.getFromInternalId(transformedId); 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) transformBaseBlockNBT(transformed, block.getNbtData(), transform);
} }
return (B) (block instanceof BaseBlock ? transformed.toBaseBlock() : transformed); return (B) (baseBlock? transformed.toBaseBlock() : transformed);
//FAWE end //FAWE end
} }