Plex-FAWE/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlanketBaseBlock.java
dordsor21 717a1b5db4
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)
2021-06-10 19:47:34 +01:00

34 lines
996 B
Java

package com.sk89q.worldedit.world.block;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.OutputExtent;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.registry.state.Property;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nullable;
/**
* BaseBlock that when parsed to masks represents all BlockStates of a BlockType, whilst allowing for NBT storage
*/
public final class BlanketBaseBlock extends BaseBlock {
public BlanketBaseBlock(BlockState blockState) {
super(blockState);
}
public BlanketBaseBlock(BlockState blockState, @NotNull CompoundTag tile) {
super(blockState, tile);
}
@Override
public BaseBlock toBaseBlock(CompoundTag compoundTag) {
if (compoundTag != null) {
return new BaseBlock(this.toImmutableState(), compoundTag);
}
return this;
}
}