From b4b0bbd081a64b6db4e74e630ccd3104a899c1df Mon Sep 17 00:00:00 2001 From: NuclearW Date: Tue, 7 Feb 2012 11:43:07 -0500 Subject: [PATCH] Make Smooth Brick to Mossy Brick and Dirt to Grass for green thumb configurable Closes issue #120 --- Changelog.txt | 1 + .../com/gmail/nossr50/config/LoadProperties.java | 5 ++++- .../gmail/nossr50/listeners/mcPlayerListener.java | 15 +++++++++------ src/main/resources/config.yml | 2 ++ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 961e4df55..57ce031b8 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4,6 +4,7 @@ Changelog: Version 2.0-dev - Removed legacy Permission & PEX support. SuperPerms support only now. - Added framework for new Mining sub-skill: Blast Mining. + - Made Smooth Brick to Mossy Brick and Dirt to Grass for green thumb configurable (Issue #120) Version 1.2.10 - Fixed issue with receiving Woodcutting XP for all blocks broken (Issue #103) diff --git a/src/main/java/com/gmail/nossr50/config/LoadProperties.java b/src/main/java/com/gmail/nossr50/config/LoadProperties.java index 89e8bf157..82551e6ac 100644 --- a/src/main/java/com/gmail/nossr50/config/LoadProperties.java +++ b/src/main/java/com/gmail/nossr50/config/LoadProperties.java @@ -42,7 +42,8 @@ public class LoadProperties { mayLoseEnchants, fishingDrops, leatherArmor, ironArmor, goldArmor, diamondArmor, woodenTools, stoneTools, ironTools, goldTools, diamondTools, enderPearl, blazeRod, records, glowstoneDust, - fishingDiamonds, aDisplayNames, pDisplayNames; + fishingDiamonds, aDisplayNames, pDisplayNames, enableSmoothToMossy, + enableDirtToGrass; public static String MySQLtablePrefix, MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, nWood, nStone, @@ -298,6 +299,8 @@ public class LoadProperties { enableRegen = readBoolean("General.HP_Regeneration.Enabled", true); enableCobbleToMossy = readBoolean("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true); + enableSmoothToMossy = readBoolean("Skills.Herbalism.Green_Thumb.SmoothBrick_To_MossyBrick", true); + enableDirtToGrass = readBoolean("Skills.Herbalism.Green_Thumb.Dirt_To_Grass", true); xpGainMultiplier = readInteger("Experience.Gains.Multiplier.Global", 1); toolsLoseDurabilityFromAbilities = readBoolean("Abilities.Tools.Durability_Loss_Enabled", true); diff --git a/src/main/java/com/gmail/nossr50/listeners/mcPlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/mcPlayerListener.java index b1fd8b2df..ac81f5b9f 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcPlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcPlayerListener.java @@ -229,19 +229,22 @@ public class mcPlayerListener implements Listener switch(block.getType()) { case COBBLESTONE: - if(LoadProperties.enableCobbleToMossy) - { + if(LoadProperties.enableCobbleToMossy) { block.setType(Material.MOSSY_COBBLESTONE); pass = true; } break; case DIRT: - pass = true; - block.setType(Material.GRASS); + if(LoadProperties.enableDirtToGrass) { + pass = true; + block.setType(Material.GRASS); + } break; case SMOOTH_BRICK: - pass = true; - block.setData((byte)1); + if(LoadProperties.enableSmoothToMossy) { + pass = true; + block.setData((byte)1); + } break; } if(pass == false) diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 15270a9ce..0cc8755a5 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -119,6 +119,8 @@ Skills: Level_Cap: 0 Green_Thumb: Cobble_To_Mossy: true + SmoothBrick_To_MossyBrick: true + Dirt_To_Grass: true Mining: Level_Cap: 0 Requires_Pickaxe: true