mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-25 17:41:50 +01:00
Add Sculk Growth Flag and options to disable sculk growths
This commit is contained in:
parent
f8e8d0f01e
commit
857f7468d8
@ -277,6 +277,7 @@ public void loadConfiguration() {
|
|||||||
disableMyceliumSpread = getBoolean("dynamics.disable-mycelium-spread", false);
|
disableMyceliumSpread = getBoolean("dynamics.disable-mycelium-spread", false);
|
||||||
disableVineGrowth = getBoolean("dynamics.disable-vine-growth", false);
|
disableVineGrowth = getBoolean("dynamics.disable-vine-growth", false);
|
||||||
disableRockGrowth = getBoolean("dynamics.disable-rock-growth", false);
|
disableRockGrowth = getBoolean("dynamics.disable-rock-growth", false);
|
||||||
|
disableSculkGrowth = getBoolean("dynamics.disable-sculk-growth", false);
|
||||||
disableCropGrowth = getBoolean("dynamics.disable-crop-growth", false);
|
disableCropGrowth = getBoolean("dynamics.disable-crop-growth", false);
|
||||||
disableSoilDehydration = getBoolean("dynamics.disable-soil-dehydration", false);
|
disableSoilDehydration = getBoolean("dynamics.disable-soil-dehydration", false);
|
||||||
disableCoralBlockFade = getBoolean("dynamics.disable-coral-block-fade", false);
|
disableCoralBlockFade = getBoolean("dynamics.disable-coral-block-fade", false);
|
||||||
|
@ -601,6 +601,19 @@ public void onBlockSpread(BlockSpreadEvent event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Materials.isSculkGrowth(newType)) {
|
||||||
|
if (wcfg.disableSculkGrowth) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wcfg.useRegions && !StateFlag.test(WorldGuard.getInstance().getPlatform().getRegionContainer().createQuery()
|
||||||
|
.queryState(BukkitAdapter.adapt(event.getBlock().getLocation()), (RegionAssociable) null, Flags.SCULK_GROWTH))) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
handleGrow(event, event.getBlock().getLocation(), newType);
|
handleGrow(event, event.getBlock().getLocation(), newType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1615,4 +1615,8 @@ public static boolean isAmethystGrowth(Material mat) {
|
|||||||
|| mat == Material.MEDIUM_AMETHYST_BUD
|
|| mat == Material.MEDIUM_AMETHYST_BUD
|
||||||
|| mat == Material.SMALL_AMETHYST_BUD;
|
|| mat == Material.SMALL_AMETHYST_BUD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isSculkGrowth(Material mat) {
|
||||||
|
return mat == Material.SCULK || mat == Material.SCULK_VEIN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,6 +159,7 @@ public abstract class WorldConfiguration {
|
|||||||
public boolean disableMyceliumSpread;
|
public boolean disableMyceliumSpread;
|
||||||
public boolean disableVineGrowth;
|
public boolean disableVineGrowth;
|
||||||
public boolean disableRockGrowth;
|
public boolean disableRockGrowth;
|
||||||
|
public boolean disableSculkGrowth;
|
||||||
public boolean disableCropGrowth;
|
public boolean disableCropGrowth;
|
||||||
public boolean disableEndermanGriefing;
|
public boolean disableEndermanGriefing;
|
||||||
public boolean disableSnowmanTrails;
|
public boolean disableSnowmanTrails;
|
||||||
|
@ -121,6 +121,7 @@ public final class Flags {
|
|||||||
public static final StateFlag MYCELIUM_SPREAD = register(new StateFlag("mycelium-spread", true));
|
public static final StateFlag MYCELIUM_SPREAD = register(new StateFlag("mycelium-spread", true));
|
||||||
public static final StateFlag VINE_GROWTH = register(new StateFlag("vine-growth", true));
|
public static final StateFlag VINE_GROWTH = register(new StateFlag("vine-growth", true));
|
||||||
public static final StateFlag ROCK_GROWTH = register(new StateFlag("rock-growth", true));
|
public static final StateFlag ROCK_GROWTH = register(new StateFlag("rock-growth", true));
|
||||||
|
public static final StateFlag SCULK_GROWTH = register (new StateFlag("sculk-growth", true));
|
||||||
public static final StateFlag CROP_GROWTH = register(new StateFlag("crop-growth", true));
|
public static final StateFlag CROP_GROWTH = register(new StateFlag("crop-growth", true));
|
||||||
public static final StateFlag SOIL_DRY = register(new StateFlag("soil-dry", true));
|
public static final StateFlag SOIL_DRY = register(new StateFlag("soil-dry", true));
|
||||||
public static final StateFlag CORAL_FADE = register(new StateFlag("coral-fade", true));
|
public static final StateFlag CORAL_FADE = register(new StateFlag("coral-fade", true));
|
||||||
|
Loading…
Reference in New Issue
Block a user