From 25e2bcbfa77f3a26a25c67aa60f51f1afa3abf64 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Mon, 30 Dec 2013 23:41:34 +0100 Subject: [PATCH] Use tree species for Woodcutting double drops in config.yml Oak is now Generic, and Spruce is now Redwood. --- Changelog.txt | 2 +- .../java/com/gmail/nossr50/config/Config.java | 6 ++-- .../skills/woodcutting/Woodcutting.java | 31 ++----------------- src/main/resources/config.yml | 6 ++-- 4 files changed, 9 insertions(+), 36 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index adc2e814c..d6aedd7d3 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -13,7 +13,7 @@ Version 1.5.00-dev + Added Salmon, Clownfish, and Pufferfish to Fishing XP + Added new flowers and grasses to Herbalism XP ! Fishing XP now depends on the type of fish. - ! Woodcutting XP in experience.yml now uses the tree species names. Oak is now Generic, and Spruce is now Redwood. + ! Woodcutting XP in experience.yml and Woodcutting double drops in config.yml now use the tree species names. Oak is now Generic, and Spruce is now Redwood. ! Red_Rose was replaced by Poppy, and so the key in experience.yml has been updated accordingly. - Removed deprecated permission nodes diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index 247f93f9c..7bb61d145 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Set; import org.bukkit.Material; +import org.bukkit.TreeSpecies; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.EntityType; @@ -456,10 +457,7 @@ public class Config extends AutoUpdateConfigLoader { public int getTamingCOTWAmount(EntityType type) { return config.getInt("Skills.Taming.Call_Of_The_Wild." + StringUtils.getPrettyEntityTypeString(type)+ "_Amount"); } /* Woodcutting */ - public boolean getOakDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Oak", true); } - public boolean getBirchDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Birch", true); } - public boolean getSpruceDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Spruce", true); } - public boolean getJungleDoubleDropsEnabled() { return config.getBoolean("Double_Drops.Woodcutting.Jungle", true); } + public boolean getWoodcuttingDoubleDropsEnabled(TreeSpecies species) { return config.getBoolean("Double_Drops.Woodcutting." + StringUtils.getPrettyTreeSpeciesString(species).replace(" ", "_")); } public boolean getTreeFellerSoundsEnabled() { return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); } /* AFK Leveling */ diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java index 717c39219..919712069 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java @@ -75,35 +75,8 @@ public final class Woodcutting { if (mcMMO.getModManager().isCustomLog(blockState) && mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) { Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); } - else { - switch (((Tree) blockState.getData()).getSpecies()) { - case GENERIC: - if (Config.getInstance().getOakDoubleDropsEnabled()) { - Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); - } - return; - - case REDWOOD: - if (Config.getInstance().getSpruceDoubleDropsEnabled()) { - Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); - } - return; - - case BIRCH: - if (Config.getInstance().getBirchDoubleDropsEnabled()) { - Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); - } - return; - - case JUNGLE: - if (Config.getInstance().getJungleDoubleDropsEnabled()) { - Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); - } - return; - - default: - return; - } + else if (Config.getInstance().getWoodcuttingDoubleDropsEnabled(((Tree) blockState.getData()).getSpecies())) { + Misc.dropItems(blockState.getLocation(), blockState.getBlock().getDrops()); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 40caf3198..858745fec 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -373,10 +373,12 @@ Double_Drops: Sandstone: true Stone: true Woodcutting: - Oak: true + Acacia: true Birch: true - Spruce: true + Dark_Oak: true + Generic: true Jungle: true + Redwood: true # # Settings for commands