diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index f6f34e009..39a26c27e 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -93,7 +93,7 @@ public class Config extends ConfigLoader{ public static Boolean miningrequirespickaxe, excavationRequiresShovel, woodcuttingrequiresaxe; /* Excavation */ - public static int mbase; + public static int getExcavationBaseXP() { return config.getInt("Experience.Excavation.Base", 40); } /* Fishing */ public static int getFishingBaseXP() { return config.getInt("Experience.Fishing.Base", 800); } @@ -105,8 +105,19 @@ public class Config extends ConfigLoader{ public static int getFishingTierLevelsTier5() { return config.getInt("Fishing.Tier_Levels.Tier5", 800); } /* Herbalism */ - public static Boolean herbalismHungerBonus, wheatRegrowth; - public static int mmelon, mcactus, mmushroom, mflower, msugar, mpumpkin, mwheat, mvines, mlilypad, mnetherwart; + public static int getHerbalismXPSugarCane() { return config.getInt("Experience.Herbalism.Sugar_Cane", 30); } + public static int getHerbalismXPWheat() { return config.getInt("Experience.Herbalism.Wheat", 50); } + public static int getHerbalismXPCactus() { return config.getInt("Experience.Herbalism.Cactus", 30); } + public static int getHerbalismXPPumpkin() { return config.getInt("Experience.Herbalism.Pumpkin", 20); } + public static int getHerbalismXPFlowers() { return config.getInt("Experience.Herbalism.Flowers", 100); } + public static int getHerbalismXPMushrooms() { return config.getInt("Experience.Herbalism.Mushrooms", 150); } + public static int getHerbalismXPMelon() { return config.getInt("Experience.Herbalism.Melon", 20); } + public static int getHerbalismXPNetherWart() { return config.getInt("Experience.Herbalism.Nether_Wart", 50); } + public static int getHerbalismXPLilyPads() { return config.getInt("Experience.Herbalism.Lily_Pads", 100); } + public static int getHerbalismXPVines() { return config.getInt("Experience.Herbalism.Vines", 10); } + public static boolean getHerbalismHungerBonusEnabled() { return config.getBoolean("Skills.Herbalism.Hunger_Bonus", true); } + public static boolean getHerbalismWheatRegrowth() { return config.getBoolean("Skills.Herbalism.Instant_Wheat_Regrowth", true); } + public static Boolean enableCobbleToMossy, enableSmoothToMossy, enableDirtToGrass; /* Mining */ @@ -316,21 +327,6 @@ public class Config extends ConfigLoader{ showFaces = config.getBoolean("Spout.Party.HUD.Show_Faces", true); showDisplayName = config.getBoolean("Spout.Party.HUD.Show_Display_Name", false); partybar = config.getBoolean("Spout.Party.HUD.Enabled", true); - - mbase = config.getInt("Experience.Excavation.Base", 40); - - msugar = config.getInt("Experience.Herbalism.Sugar_Cane", 30); - mwheat = config.getInt("Experience.Herbalism.Wheat", 50); - mcactus = config.getInt("Experience.Herbalism.Cactus", 30); - mpumpkin = config.getInt("Experience.Herbalism.Pumpkin", 20); - mflower = config.getInt("Experience.Herbalism.Flowers", 100); - mmushroom = config.getInt("Experience.Herbalism.Mushrooms", 150); - mmelon = config.getInt("Experience.Herbalism.Melon", 20); - mnetherwart = config.getInt("Experience.Herbalism.Nether_Wart", 50); - mlilypad = config.getInt("Experience.Herbalism.Lily_Pads", 100); - mvines = config.getInt("Experience.Herbalism.Vines", 10); - herbalismHungerBonus = config.getBoolean("Skills.Herbalism.Hunger_Bonus", true); - wheatRegrowth = config.getBoolean("Skills.Herbalism.Instant_Wheat_Regrowth", true); moak = config.getInt("Experience.Woodcutting.Oak", 70); mbirch = config.getInt("Experience.Woodcutting.Birch", 90); diff --git a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java index f8e10e515..a1275439d 100644 --- a/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/mcEntityListener.java @@ -219,7 +219,7 @@ public class mcEntityListener implements Listener { */ @EventHandler (priority = EventPriority.LOW) public void onFoodLevelChange(FoodLevelChangeEvent event) { - if (Config.herbalismHungerBonus) { + if (Config.getHerbalismHungerBonusEnabled()) { if (event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); PlayerProfile PP = Users.getProfile(player); diff --git a/src/main/java/com/gmail/nossr50/skills/Excavation.java b/src/main/java/com/gmail/nossr50/skills/Excavation.java index e2e100a56..bf9377106 100644 --- a/src/main/java/com/gmail/nossr50/skills/Excavation.java +++ b/src/main/java/com/gmail/nossr50/skills/Excavation.java @@ -66,7 +66,7 @@ public class Excavation { List treasures = new ArrayList(); - int xp = Config.mbase; + int xp = Config.getExcavationBaseXP(); if (mcPermissions.getInstance().excavationTreasures(player)) { switch (type) { diff --git a/src/main/java/com/gmail/nossr50/skills/Herbalism.java b/src/main/java/com/gmail/nossr50/skills/Herbalism.java index b16d8e76d..b6db684c4 100644 --- a/src/main/java/com/gmail/nossr50/skills/Herbalism.java +++ b/src/main/java/com/gmail/nossr50/skills/Herbalism.java @@ -132,7 +132,7 @@ public class Herbalism { case RED_MUSHROOM: if (!block.hasMetadata("mcmmoPlacedBlock")) { mat = Material.getMaterial(id); - xp = Config.mmushroom; + xp = Config.getHerbalismXPMushrooms(); } break; @@ -145,7 +145,7 @@ public class Herbalism { if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) { catciDrops++; } - xp += Config.mcactus; + xp += Config.getHerbalismXPCactus(); } } } @@ -154,9 +154,9 @@ public class Herbalism { case CROPS: if (data == CropState.RIPE.getData()) { mat = Material.WHEAT; - xp = Config.mwheat; + xp = Config.getHerbalismXPWheat(); - if (Config.wheatRegrowth && mcPermissions.getInstance().greenThumbWheat(player)) { + if (Config.getHerbalismWheatRegrowth() && mcPermissions.getInstance().greenThumbWheat(player)) { greenThumbWheat(block, player, event, plugin); } } @@ -165,14 +165,14 @@ public class Herbalism { case MELON_BLOCK: if (!block.hasMetadata("mcmmoPlacedBlock")) { mat = Material.MELON; - xp = Config.mmelon; + xp = Config.getHerbalismXPMelon(); } break; case NETHER_WARTS: if (data == (byte) 0x3) { mat = Material.NETHER_STALK; - xp = Config.mnetherwart; + xp = Config.getHerbalismXPNetherWart(); } break; @@ -180,7 +180,7 @@ public class Herbalism { case JACK_O_LANTERN: if (!block.hasMetadata("mcmmoPlacedBlock")) { mat = Material.getMaterial(id); - xp = Config.mpumpkin; + xp = Config.getHerbalismXPPumpkin(); } break; @@ -188,7 +188,7 @@ public class Herbalism { case YELLOW_FLOWER: if (!block.hasMetadata("mcmmoPlacedBlock")) { mat = Material.getMaterial(id); - xp = Config.mflower; + xp = Config.getHerbalismXPFlowers(); } break; @@ -201,7 +201,7 @@ public class Herbalism { if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) { caneDrops++; } - xp += Config.msugar; + xp += Config.getHerbalismXPSugarCane(); } } } @@ -210,14 +210,14 @@ public class Herbalism { case VINE: if (!block.hasMetadata("mcmmoPlacedBlock")) { mat = type; - xp = Config.mvines; + xp = Config.getHerbalismXPVines(); } break; case WATER_LILY: if (!block.hasMetadata("mcmmoPlacedBlock")) { mat = type; - xp = Config.mlilypad; + xp = Config.getHerbalismXPLilyPads(); } break;