mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-06 20:56:41 +00:00
Further BaseBlock modernisation
This commit is contained in:
@ -104,7 +104,7 @@ public class ExtentBlockCopy implements RegionFunction {
|
||||
|
||||
builder.putByte("Rot", (byte) MCDirections.toRotation(newDirection));
|
||||
|
||||
return new BaseBlock(state.getType(), state.getStates(), builder.build());
|
||||
return new BaseBlock(state.getState(), builder.build());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -106,10 +106,10 @@ public class FloraGenerator implements RegionFunction {
|
||||
public boolean apply(Vector position) throws WorldEditException {
|
||||
BaseBlock block = editSession.getBlock(position);
|
||||
|
||||
if (block.getType() == BlockTypes.GRASS) {
|
||||
if (block.getBlockType() == BlockTypes.GRASS) {
|
||||
editSession.setBlock(position.add(0, 1, 0), temperatePattern.apply(position));
|
||||
return true;
|
||||
} else if (block.getType() == BlockTypes.SAND) {
|
||||
} else if (block.getBlockType() == BlockTypes.SAND) {
|
||||
editSession.setBlock(position.add(0, 1, 0), desertPattern.apply(position));
|
||||
return true;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class ForestGenerator implements RegionFunction {
|
||||
@Override
|
||||
public boolean apply(Vector position) throws WorldEditException {
|
||||
BaseBlock block = editSession.getBlock(position);
|
||||
BlockType t = block.getType();
|
||||
BlockType t = block.getBlockType();
|
||||
|
||||
if (t == BlockTypes.GRASS || t == BlockTypes.DIRT) {
|
||||
treeGenerator.generate(editSession, position.add(0, 1, 0));
|
||||
|
@ -163,7 +163,7 @@ public class GardenPatchGenerator implements RegionFunction {
|
||||
position = position.add(0, 1, 0);
|
||||
}
|
||||
|
||||
if (editSession.getBlock(position.add(0, -1, 0)).getType() != BlockTypes.GRASS) {
|
||||
if (editSession.getBlock(position.add(0, -1, 0)).getBlockType() != BlockTypes.GRASS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class BlockMask extends AbstractExtentMask {
|
||||
@Override
|
||||
public boolean test(Vector vector) {
|
||||
BaseBlock block = getExtent().getBlock(vector);
|
||||
return blocks.contains(block) || blocks.contains(new BaseBlock(block.getType()));
|
||||
return blocks.contains(block) || blocks.contains(new BaseBlock(block.getBlockType()));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -41,7 +41,7 @@ public class FuzzyBlockMask extends BlockMask {
|
||||
Extent extent = getExtent();
|
||||
Collection<BaseBlock> blocks = getBlocks();
|
||||
BaseBlock lazyBlock = extent.getLazyBlock(vector);
|
||||
BaseBlock compare = new BaseBlock(lazyBlock.getType(), lazyBlock.getStates());
|
||||
BaseBlock compare = new BaseBlock(lazyBlock.getState());
|
||||
return Blocks.containsFuzzy(blocks, compare);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class SolidBlockMask extends AbstractExtentMask {
|
||||
public boolean test(Vector vector) {
|
||||
Extent extent = getExtent();
|
||||
BaseBlock lazyBlock = extent.getLazyBlock(vector);
|
||||
return !BlockType.canPassThrough(lazyBlock.getType().getLegacyId(), lazyBlock.getData());
|
||||
return !BlockType.canPassThrough(lazyBlock.getBlockType().getLegacyId(), lazyBlock.getData());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
Reference in New Issue
Block a user