mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Add a material to check if air is air, because there are now 3 types of air.
This commit is contained in:
@ -54,7 +54,7 @@ public class AreaPickaxe implements BlockTool {
|
||||
int oz = clicked.getBlockZ();
|
||||
BlockType initialType = clicked.getExtent().getBlock(clicked.toVector()).getBlockType();
|
||||
|
||||
if (initialType == BlockTypes.AIR) {
|
||||
if (initialType.getMaterial().isAir()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ public class FloatingTreeRemover implements BlockTool {
|
||||
|
||||
if (visited.add(next)) {
|
||||
BlockState state = world.getBlock(next);
|
||||
if (state.getBlockType() == BlockTypes.AIR || state.getBlockType() == BlockTypes.SNOW) {
|
||||
if (state.getBlockType().getMaterial().isAir() || state.getBlockType() == BlockTypes.SNOW) {
|
||||
continue;
|
||||
}
|
||||
if (isTreeBlock(state.getBlockType())) {
|
||||
|
@ -61,7 +61,7 @@ public class FloodFillTool implements BlockTool {
|
||||
|
||||
BlockType initialType = world.getBlock(clicked.toVector()).getBlockType();
|
||||
|
||||
if (initialType == BlockTypes.AIR) {
|
||||
if (initialType.getMaterial().isAir()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
|
||||
EditSession eS = session.createEditSession(player);
|
||||
try {
|
||||
BlockStateHolder applied = secondary.apply(pos.toVector());
|
||||
if (applied.getBlockType() == BlockTypes.AIR) {
|
||||
if (applied.getBlockType().getMaterial().isAir()) {
|
||||
eS.setBlock(pos.toVector(), secondary);
|
||||
} else {
|
||||
eS.setBlock(pos.getDirection(), secondary);
|
||||
@ -77,7 +77,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
|
||||
EditSession eS = session.createEditSession(player);
|
||||
try {
|
||||
BlockStateHolder applied = primary.apply(pos.toVector());
|
||||
if (applied.getBlockType() == BlockTypes.AIR) {
|
||||
if (applied.getBlockType().getMaterial().isAir()) {
|
||||
eS.setBlock(pos.toVector(), primary);
|
||||
} else {
|
||||
eS.setBlock(pos.getDirection(), primary);
|
||||
|
@ -58,7 +58,7 @@ public class RecursivePickaxe implements BlockTool {
|
||||
|
||||
BlockType initialType = world.getBlock(clicked.toVector()).getBlockType();
|
||||
|
||||
if (initialType == BlockTypes.AIR) {
|
||||
if (initialType.getMaterial().isAir()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class GravityBrush implements Brush {
|
||||
for (; y > position.getBlockY() - size; --y) {
|
||||
final Vector pt = new Vector(x, y, z);
|
||||
final BlockStateHolder block = editSession.getBlock(pt);
|
||||
if (block.getBlockType() != BlockTypes.AIR) {
|
||||
if (!block.getBlockType().getMaterial().isAir()) {
|
||||
blockTypes.add(block);
|
||||
editSession.setBlock(pt, BlockTypes.AIR.getDefaultState());
|
||||
}
|
||||
@ -56,7 +56,7 @@ public class GravityBrush implements Brush {
|
||||
Vector pt = new Vector(x, y, z);
|
||||
Collections.reverse(blockTypes);
|
||||
for (int i = 0; i < blockTypes.size();) {
|
||||
if (editSession.getBlock(pt).getBlockType() == BlockTypes.AIR) {
|
||||
if (editSession.getBlock(pt).getBlockType().getMaterial().isAir()) {
|
||||
editSession.setBlock(pt, blockTypes.get(i++));
|
||||
}
|
||||
pt = pt.add(0, 1, 0);
|
||||
|
Reference in New Issue
Block a user