mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-06 20:56: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:
@ -102,7 +102,7 @@ public class TargetBlock {
|
||||
boolean searchForLastBlock = true;
|
||||
Location lastBlock = null;
|
||||
while (getNextBlock() != null) {
|
||||
if (world.getBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) {
|
||||
if (world.getBlock(getCurrentBlock().toVector()).getBlockType().getMaterial().isAir()) {
|
||||
if (searchForLastBlock) {
|
||||
lastBlock = getCurrentBlock();
|
||||
if (lastBlock.getBlockY() <= 0 || lastBlock.getBlockY() >= world.getMaxY()) {
|
||||
@ -124,7 +124,7 @@ public class TargetBlock {
|
||||
* @return Block
|
||||
*/
|
||||
public Location getTargetBlock() {
|
||||
while (getNextBlock() != null && world.getBlock(getCurrentBlock().toVector()).getBlockType() == BlockTypes.AIR) ;
|
||||
while (getNextBlock() != null && world.getBlock(getCurrentBlock().toVector()).getBlockType().getMaterial().isAir()) ;
|
||||
return getCurrentBlock();
|
||||
}
|
||||
|
||||
|
@ -264,6 +264,6 @@ public class TreeGenerator {
|
||||
* @throws MaxChangedBlocksException thrown if too many blocks are changed
|
||||
*/
|
||||
private static boolean setBlockIfAir(EditSession session, Vector position, BlockStateHolder block) throws MaxChangedBlocksException {
|
||||
return session.getBlock(position).getBlockType() == BlockTypes.AIR && session.setBlock(position, block);
|
||||
return session.getBlock(position).getBlockType().getMaterial().isAir() && session.setBlock(position, block);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user