Moved report framework to WorldEdit and fixed a few bugs.

This commit is contained in:
Matthew Miller
2018-08-15 12:45:18 +10:00
parent 96388df4b0
commit c31161d068
11 changed files with 640 additions and 18 deletions

View File

@ -34,18 +34,13 @@ import java.util.Objects;
import javax.annotation.Nullable;
/**
* Represents a mutable "snapshot" of a block.
* Represents a "snapshot" of a block with NBT Data.
*
* <p>An instance of this block contains all the information needed to
* accurately reproduce the block, provided that the instance was
* made correctly. In some implementations, it may not be possible to get a
* snapshot of blocks correctly, so, for example, the NBT data for a block
* may be missing.</p>
*
* <p>A peculiar detail of this class is that it accepts {@code -1} as a
* valid data value. This is due to legacy reasons: WorldEdit uses -1
* as a "wildcard" block value, even though a {@link Mask} would be
* more appropriate.</p>
*/
public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
@ -73,15 +68,6 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
this.nbtData = nbtData;
}
/**
* Create a clone of another block.
*
* @param other the other block
*/
public BaseBlock(BaseBlock other) {
this(other.toImmutableState(), other.getNbtData());
}
/**
* Gets a map of state to statevalue
*
@ -99,7 +85,7 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
@Override
public <V> BaseBlock with(Property<V> property, V value) {
return new BaseBlock(this.blockState.with(property, value), getNbtData());
return this.blockState.with(property, value).toBaseBlock(getNbtData());
}
/**