From faab64864a7ded7d34c54803855afa97002181ce Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 23 Mar 2019 18:07:23 -0700 Subject: [PATCH] Fixing Double Drops for Mining -- READ THE FULL COMMIT MSG This fix is very similar to what was deployed for Herbalism in 2.1.22 NOTE: Here's what your Double_Drop entries in Config.yml for Mining should look like https://paste.gg/p/anonymous/dcd06f1215844311b4f2225f200090d1 IMPORTANT: Version 2.1.22 which came before this had a similar fix for Herbalism, instructions on how to fix your Herbalism Double Drops can be found here https://www.spigotmc.org/resources/official-mcmmo.64348/update?update=269868 --- Changelog.txt | 9 +++++++++ pom.xml | 2 +- .../java/com/gmail/nossr50/skills/mining/Mining.java | 3 +++ .../gmail/nossr50/skills/mining/MiningManager.java | 11 ++--------- src/main/resources/config.yml | 3 +++ 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 52396809d..c5144ef07 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -7,6 +7,15 @@ Key: ! Change - Removal +Version 2.1.23 + Fixed a bug with Double Drops for Mining + Note: You'll need to add these entries to your config.yml manually, or wait for the upcoming config update where this will be fixed for you automatically. + NOTE: Here's what your Double_Drop entries in Config.yml for Mining should look like + https://paste.gg/p/anonymous/dcd06f1215844311b4f2225f200090d1 + IMPORTANT: Version 2.1.22 which came before this had a similar fix for Herbalism, instructions on how to fix your Herbalism Double Drops can be found here + https://www.spigotmc.org/resources/official-mcmmo.64348/update?update=269868 + NOTE: Due to the nature of these fixes, Fortune enchants now work with Double/Triple drops + Version 2.1.22 Less aggressive spam click protection on Fishing Updated Hungarian file for missing entries related to Fishing messages (credit: andris155) diff --git a/pom.xml b/pom.xml index a6bb36080..4d5b54184 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.22 + 2.1.23-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO diff --git a/src/main/java/com/gmail/nossr50/skills/mining/Mining.java b/src/main/java/com/gmail/nossr50/skills/mining/Mining.java index 91e5d156e..288736726 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/Mining.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/Mining.java @@ -34,6 +34,9 @@ public class Mining { Material blockType = blockState.getType(); switch (blockType) { + case ANDESITE: + case DIORITE: + case GRANITE: case END_STONE: case TERRACOTTA: case CLAY: diff --git a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java index 2ac8978a6..6437d7ef7 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -91,15 +91,8 @@ public class MiningManager extends SkillManager { return; //TODO: Make this readable - for (int i = mcMMOPlayer.getAbilityMode(skill.getAbility()) ? 2 : 1; i != 0; i--) { - if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.MINING_DOUBLE_DROPS, player)) { - if (silkTouch) { - Mining.handleSilkTouchDrops(blockState); - } - else { - Mining.handleMiningDrops(blockState); - } - } + if (RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), SubSkillType.MINING_DOUBLE_DROPS, true)) { + BlockUtils.markBlocksForBonusDrops(blockState, mcMMOPlayer.getAbilityMode(skill.getAbility())); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 2c7ea0e87..4c616b22d 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -457,6 +457,9 @@ Double_Drops: Rose_Bush: true Peony: true Mining: + Andesite: true + Diorite: true + Granite: true Coal_Ore: true Diamond_Ore: true Emerald_Ore: true