From 9b438d0caa21025ede65e30e4f0cec7c4e96bc0c Mon Sep 17 00:00:00 2001 From: bm01 Date: Sun, 29 Apr 2012 01:59:56 +0200 Subject: [PATCH] Fixed Blast Mining not giving triple drop when it should --- Changelog.txt | 1 + .../com/gmail/nossr50/skills/BlastMining.java | 20 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 5c41ca1b7..66980ee68 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -25,6 +25,7 @@ Version 1.3.06-dev = Fixed bugs with the way /mctop displayed = Fixed issues with custom characters & locale files. = Fixed double explosion for Blast Mining + = Fixed Blast Mining not giving triple drops when it should ! Changed how we handled the config file to prevent any bugs when returning values ! Changed locale files to use a new naming scheme. This breaks ALL old locale files. If you want to assist with re-translating anything, go to getlocalization.com/mcMMO ! Changed mcremove to check for users in the MySQL DB before sending queries to remove them diff --git a/src/main/java/com/gmail/nossr50/skills/BlastMining.java b/src/main/java/com/gmail/nossr50/skills/BlastMining.java index 2f0fe6f16..e0804b76c 100644 --- a/src/main/java/com/gmail/nossr50/skills/BlastMining.java +++ b/src/main/java/com/gmail/nossr50/skills/BlastMining.java @@ -41,22 +41,18 @@ public class BlastMining { * @return A list of blocks dropped from the explosion */ private static List explosionYields(List ores, List debris, float yield, float oreBonus, float debrisReduction, int extraDrops) { - Iterator iterator2 = ores.iterator(); + Iterator oresIterator = ores.iterator(); List blocksDropped = new ArrayList(); - while (iterator2.hasNext()) { - Block temp = iterator2.next(); + while (oresIterator.hasNext()) { + Block temp = oresIterator.next(); if (random.nextFloat() < (yield + oreBonus)) { blocksDropped.add(temp); Mining.miningDrops(temp); if (!temp.hasMetadata("mcmmoPlacedBlock")) { - if (extraDrops == 2) { - blocksDropped.add(temp); - Mining.miningDrops(temp); - } - if (extraDrops == 3) { + for (int i = 1 ; i < extraDrops ; i++) { blocksDropped.add(temp); Mining.miningDrops(temp); } @@ -64,11 +60,11 @@ public class BlastMining { } } - if (yield - debrisReduction != 0) { - Iterator iterator3 = debris.iterator(); + if (yield - debrisReduction > 0) { + Iterator debrisIterator = debris.iterator(); - while (iterator3.hasNext()) { - Block temp = iterator3.next(); + while (debrisIterator.hasNext()) { + Block temp = debrisIterator.next(); if (random.nextFloat() < (yield - debrisReduction)) Mining.miningDrops(temp);