From b7d33f022738c9ed25c66eb80c894a4f248cec93 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 29 Mar 2019 18:11:32 -0700 Subject: [PATCH] Adding missing Double Drop entries for Woodcutting --- Changelog.txt | 7 +++++-- src/main/java/com/gmail/nossr50/config/Config.java | 8 ++++---- src/main/resources/config.yml | 8 +++++++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 78e96c278..a9d59d5e2 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -9,10 +9,13 @@ Key: Version 2.1.30 Fixed double drops behaving oddly + Double_Drop config table has been renamed to Bonus_Drops, this is to jankily auto-update everyones config DoubleDrop config tables now must contain all things that can possibly be doubled, such as the Ore block, the ore itself, etc. - Added the following items to the DoubleDrop tables for Mining: Coal, Diamond, Emerald, Glowstone_Dust, Iron_Ingot, Lapis_Lazuli, Nether_Quartz, Redstone, Cobblestone - Added the following items to the DoubleDrop tables for Herbalism: Beetroot, Carrot, Cocoa_Beans, Melon_Slice, Potatoe + Added the following items to the Bonus_Drops tables for Mining: Coal, Diamond, Emerald, Glowstone_Dust, Iron_Ingot, Lapis_Lazuli, Nether_Quartz, Redstone, Cobblestone + Added the following items to the Bonus_Drops tables for Herbalism: Beetroot, Carrot, Cocoa_Beans, Melon_Slice, Potatoe + Added the following items to the Bonus_Drops tables for Woodcutting: Birch_Wood, Spruce_Wood, Jungle_Wood, Dark_Oak_Wood, Oak_Wood, Acacia_Wood + NOTE: You don't need to update your configs for this one unless you had custom entries in the Double_Drop tables, the renaming of the key will auto-insert default values and give everyone correct defaults NOTE: I'm gonna have to blame Bukkit on this one, several API methods I used are actually unfinished and kind of janky. So I hacked something together to make them work. Version 2.1.29 diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index ddbd86cd8..73deca695 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -463,18 +463,18 @@ public class Config extends AutoUpdateConfigLoader { /* * SKILL SETTINGS */ - public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { return config.getBoolean("Double_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); } + public boolean getDoubleDropsEnabled(PrimarySkillType skill, Material material) { return config.getBoolean("Bonus_Drops." + StringUtils.getCapitalized(skill.toString()) + "." + StringUtils.getPrettyItemString(material).replace(" ", "_")); } public boolean getDoubleDropsDisabled(PrimarySkillType skill) { String skillName = StringUtils.getCapitalized(skill.toString()); - ConfigurationSection section = config.getConfigurationSection("Double_Drops." + skillName); + ConfigurationSection section = config.getConfigurationSection("Bonus_Drops." + skillName); if (section == null) return false; Set keys = section.getKeys(false); boolean disabled = true; for (String key : keys) { - if (config.getBoolean("Double_Drops." + skillName + "." + key)) { + if (config.getBoolean("Bonus_Drops." + skillName + "." + key)) { disabled = false; break; } @@ -540,7 +540,7 @@ public class Config extends AutoUpdateConfigLoader { public double getTamingCOTWRange() { return config.getDouble("Skills.Taming.Call_Of_The_Wild.Range", 40.0D); } /* Woodcutting */ - public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) { return config.getBoolean("Double_Drops.Woodcutting." + StringUtils.getFriendlyConfigBlockDataString(material)); } + public boolean getWoodcuttingDoubleDropsEnabled(BlockData material) { return config.getBoolean("Bonus_Drops.Woodcutting." + StringUtils.getFriendlyConfigBlockDataString(material)); } public boolean getTreeFellerSoundsEnabled() { return config.getBoolean("Skills.Woodcutting.Tree_Feller_Sounds", true); } public int getWoodcuttingGate() { return config.getInt("Skills.Woodcutting.Ability_Activation_Level_Gate", 10); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index d8985d5d8..fd7507450 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -426,7 +426,7 @@ Skills: # # Settings for Double Drops ### -Double_Drops: +Bonus_Drops: Herbalism: Beetroots: true Beetroot: true @@ -490,11 +490,17 @@ Double_Drops: Stone: true Cobblestone: true Woodcutting: + Acacia_Wood: true Acacia_Log: true + Birch_Wood: true Birch_Log: true + Dark_Oak_Wood: true Dark_Oak_Log: true + Oak_Wood: true Oak_Log: true + Jungle_Wood: true Jungle_Log: true + Spruce_Wood: true Spruce_Log: true #