mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-05 23:11:33 +01:00
Added snow-fall-blocks option to config to restrict snow fall to certain blocks
This commit is contained in:
parent
ac525958c5
commit
0a54779fc4
@ -163,6 +163,7 @@ public class WorldConfiguration {
|
||||
public boolean disableEndermanGriefing;
|
||||
public boolean disableSnowmanTrails;
|
||||
public boolean disableSoilDehydration;
|
||||
public Set<Integer> allowedSnowFallOver;
|
||||
public boolean regionInvinciblityRemovesMobs;
|
||||
public boolean disableDeathMessages;
|
||||
public boolean disableObsidianGenerators;
|
||||
@ -403,6 +404,7 @@ private void loadConfiguration() {
|
||||
disableMyceliumSpread = getBoolean("dynamics.disable-mycelium-spread", false);
|
||||
disableVineGrowth = getBoolean("dynamics.disable-vine-growth", false);
|
||||
disableSoilDehydration = getBoolean("dynamics.disable-soil-dehydration", false);
|
||||
allowedSnowFallOver = new HashSet<Integer>(getIntList("dynamics.snow-fall-blocks", null));
|
||||
|
||||
useRegions = getBoolean("regions.enable", true);
|
||||
regionInvinciblityRemovesMobs = getBoolean("regions.invincibility-removes-mobs", false);
|
||||
|
@ -702,6 +702,14 @@ public void onBlockForm(BlockFormEvent event) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
if (wcfg.allowedSnowFallOver.size() > 0) {
|
||||
int targetId = event.getBlock().getRelative(0, -1, 0).getTypeId();
|
||||
|
||||
if (!wcfg.allowedSnowFallOver.contains(targetId)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (wcfg.useRegions && !plugin.getGlobalRegionManager().allows(
|
||||
DefaultFlag.SNOW_FALL, event.getBlock().getLocation())) {
|
||||
event.setCancelled(true);
|
||||
|
Loading…
Reference in New Issue
Block a user