From b6b0df47eb330e578a871f6fdace688f024a1217 Mon Sep 17 00:00:00 2001 From: Brianna Date: Sun, 5 Apr 2020 09:18:55 -0400 Subject: [PATCH] Added option to scan blocks underwater without scanning the water blocks --- .../com/songoda/skyblock/blockscanner/BlockScanner.java | 6 +++--- src/main/resources/config.yml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/songoda/skyblock/blockscanner/BlockScanner.java b/src/main/java/com/songoda/skyblock/blockscanner/BlockScanner.java index 345a529d..0dac9ab7 100644 --- a/src/main/java/com/songoda/skyblock/blockscanner/BlockScanner.java +++ b/src/main/java/com/songoda/skyblock/blockscanner/BlockScanner.java @@ -93,7 +93,7 @@ public final class BlockScanner extends BukkitRunnable { final ConfigurationSection liquidSection = config.getConfigurationSection("Island.World." + env + ".Liquid"); for (List sub : parts) { - queueWork(world, liquidSection.getBoolean("Enable") ? liquidSection.getInt("Height") + 1 : 0, sub); + queueWork(world, liquidSection.getBoolean("Enable") && !config.getBoolean("Island.Levelling.ScanLiquid") ? liquidSection.getInt("Height") + 1 : 0, sub); } } @@ -114,9 +114,9 @@ public final class BlockScanner extends BukkitRunnable { for (int z = 0; z < 16; z++) { for (int y = scanY; y < 256; y++) { - final Material type = VERSION > 12 ? shot.getBlockType(x, y, z) : MaterialIDHelper.getLegacyMaterial(getBlockTypeID(shot, x, y, z)); + final CompatibleMaterial type = CompatibleMaterial.getMaterial(shot.getBlockType(x, y, z)); - if (type == Material.AIR) continue; + if (type == CompatibleMaterial.AIR || type == CompatibleMaterial.WATER) continue; blocks.add(new BlockInfo(world, x + (cX), y, z + (cZ))); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 8d901432..47a08ba2 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -178,6 +178,8 @@ Island: # time cycle or be fixed. Cycle: false Levelling: + # Should the level scanner scan water? + ScanLiquid: false # Run a scan automatically when pasting an island structure ScanAutomatically: true # Include Points: 0 in the '/is level' GUI