mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-25 09:04:27 +00:00
Convert the data system to a state system. This doesn't work, needs new data
This commit is contained in:
@ -23,9 +23,13 @@ import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldedit.blocks.type.BlockType;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.world.registry.state.State;
|
||||
import com.sk89q.worldedit.world.registry.state.value.StateValue;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* A implementation of a lazy block for {@link Extent#getLazyBlock(Vector)}
|
||||
* that takes the block's ID and metadata, but will defer loading of NBT
|
||||
@ -78,13 +82,13 @@ public class LazyBlock extends BaseBlock {
|
||||
* Create a new lazy block.
|
||||
*
|
||||
* @param type the block type
|
||||
* @param data the data value
|
||||
* @param states the block states
|
||||
* @param extent the extent to later load the full block data from
|
||||
* @param position the position to later load the full block data from
|
||||
*/
|
||||
@Deprecated
|
||||
public LazyBlock(BlockType type, int data, Extent extent, Vector position) {
|
||||
super(type, data);
|
||||
public LazyBlock(BlockType type, Map<State, StateValue> states, Extent extent, Vector position) {
|
||||
super(type, states);
|
||||
checkNotNull(extent);
|
||||
checkNotNull(position);
|
||||
this.extent = extent;
|
||||
@ -123,6 +127,11 @@ public class LazyBlock extends BaseBlock {
|
||||
throw new UnsupportedOperationException("This object is immutable");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setState(State state, StateValue stateValue) {
|
||||
throw new UnsupportedOperationException("This object is immutable");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundTag getNbtData() {
|
||||
if (!loaded) {
|
||||
|
@ -67,7 +67,7 @@ public class BlockMask extends AbstractMask {
|
||||
public boolean matches(EditSession editSession, Vector position) {
|
||||
BaseBlock block = editSession.getBlock(position);
|
||||
return blocks.contains(block)
|
||||
|| blocks.contains(new BaseBlock(block.getType(), -1));
|
||||
|| blocks.contains(new BaseBlock(block.getType()));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user