Replace ImmutableBaseBlock with BlanketBaseBlock

- ImmutableBaseBlock is no longer needed as NBT was made immutable previously
 - BlanketBaseBlock represents to masks that the block has NBT, but does not need to match a specific state
 - Allow FuzzyBlockState to create BaseBlocks without NBT data (fixed tab completion issues)
This commit is contained in:
dordsor21
2021-06-10 19:47:34 +01:00
parent e11a2d7f6d
commit 717a1b5db4
6 changed files with 50 additions and 64 deletions

View File

@ -57,6 +57,7 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.block.FuzzyBlockState;
import com.sk89q.worldedit.world.block.BlanketBaseBlock;
import com.sk89q.worldedit.world.entity.EntityType;
import com.sk89q.worldedit.world.entity.EntityTypes;
import com.sk89q.worldedit.world.registry.LegacyMapper;
@ -417,7 +418,8 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
}
if (nbt != null) {
return validate(context, state.toBaseBlock(nbt));
BaseBlock result = blockStates.size() > 0 ? state.toBaseBlock(nbt) : new BlanketBaseBlock(state, nbt);
return validate(context, result);
}
if (blockType == BlockTypes.SIGN || blockType == BlockTypes.WALL_SIGN