Added config option and flag to prevent soil from drying naturally.

This commit is contained in:
wizjany 2013-08-12 18:06:31 -04:00
parent 458cf64501
commit ac525958c5
3 changed files with 17 additions and 1 deletions

View File

@ -162,12 +162,14 @@ public class WorldConfiguration {
public boolean disableVineGrowth;
public boolean disableEndermanGriefing;
public boolean disableSnowmanTrails;
public boolean disableSoilDehydration;
public boolean regionInvinciblityRemovesMobs;
public boolean disableDeathMessages;
public boolean disableObsidianGenerators;
private Map<String, Integer> maxRegionCounts;
/* Configuration data end */
/**
@ -400,6 +402,7 @@ private void loadConfiguration() {
disableGrassGrowth = getBoolean("dynamics.disable-grass-growth", false);
disableMyceliumSpread = getBoolean("dynamics.disable-mycelium-spread", false);
disableVineGrowth = getBoolean("dynamics.disable-vine-growth", false);
disableSoilDehydration = getBoolean("dynamics.disable-soil-dehydration", false);
useRegions = getBoolean("regions.enable", true);
regionInvinciblityRemovesMobs = getBoolean("regions.invincibility-removes-mobs", false);

View File

@ -833,6 +833,18 @@ public void onBlockFade(BlockFadeEvent event) {
return;
}
}
if (type == BlockID.SOIL) {
if (wcfg.disableSoilDehydration) {
event.setCancelled(true);
return;
}
if (wcfg.useRegions && !plugin.getGlobalRegionManager().allows(
DefaultFlag.SOIL_DRY, event.getBlock().getLocation())) {
event.setCancelled(true);
return;
}
}
}
/*

View File

@ -60,6 +60,7 @@ public final class DefaultFlag {
public static final StateFlag GRASS_SPREAD = new StateFlag("grass-growth", true);
public static final StateFlag MYCELIUM_SPREAD = new StateFlag("mycelium-spread", true);
public static final StateFlag VINE_GROWTH = new StateFlag("vine-growth", true);
public static final StateFlag SOIL_DRY = new StateFlag("soil-dry", true);
public static final StateFlag ENDER_BUILD = new StateFlag("enderman-grief", true);
public static final StateFlag INVINCIBILITY = new StateFlag("invincible", false, RegionGroup.ALL);
public static final StateFlag EXP_DROPS = new StateFlag("exp-drops", true, RegionGroup.ALL);
@ -106,7 +107,7 @@ public final class DefaultFlag {
ENTITY_ITEM_FRAME_DESTROY, ITEM_DROP, /*MAX_PLAYERS, MAX_PLAYERS_MESSAGE,*/
HEAL_AMOUNT, HEAL_DELAY, MIN_HEAL, MAX_HEAL,
FEED_DELAY, FEED_AMOUNT, MIN_FOOD, MAX_FOOD,
SNOW_FALL, SNOW_MELT, ICE_FORM, ICE_MELT, GAME_MODE,
SNOW_FALL, SNOW_MELT, ICE_FORM, ICE_MELT, SOIL_DRY, GAME_MODE,
MUSHROOMS, LEAF_DECAY, GRASS_SPREAD, MYCELIUM_SPREAD, VINE_GROWTH,
SEND_CHAT, RECEIVE_CHAT, FIRE_SPREAD, LAVA_FIRE, LAVA_FLOW, WATER_FLOW,
TELE_LOC, SPAWN_LOC, POTION_SPLASH,