Add config toggle for Blast Mining bonus drops to advanced.yml

This commit is contained in:
nossr50 2023-02-19 13:40:14 -08:00
parent 643dff7915
commit af15617196
6 changed files with 21 additions and 50 deletions

View File

@ -1,3 +1,6 @@
Version 2.1.219
Added 'Skills.Mining.BlastMining.Bonus_Drops.Enabled' to advanced.yml to enable/disable bonus drops from Blast Mining
Version 2.1.218 Version 2.1.218
Fixed locale pt_BR type (thanks MrPowerGamerBR) Fixed locale pt_BR type (thanks MrPowerGamerBR)
Updated Russian Locale (thanks imDaniX) Updated Russian Locale (thanks imDaniX)

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId> <groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId> <artifactId>mcMMO</artifactId>
<version>2.1.218</version> <version>2.1.219-SNAPSHOT</version>
<name>mcMMO</name> <name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url> <url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm> <scm>

View File

@ -777,6 +777,10 @@ public class AdvancedConfig extends BukkitConfig {
return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + rank); return config.getDouble("Skills.Mining.BlastMining.OreBonus.Rank_" + rank);
} }
public boolean isBlastMiningBonusDropsEnabled() {
return config.getBoolean("Skills.Mining.BlastMining.Bonus_Drops.Enabled", true);
}
public double getDebrisReduction(int rank) { public double getDebrisReduction(int rank) {
return config.getDouble("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank); return config.getDouble("Skills.Mining.BlastMining.DebrisReduction.Rank_" + rank);
} }

View File

@ -27,40 +27,6 @@ public enum PrimarySkillType {
TAMING, TAMING,
UNARMED, UNARMED,
WOODCUTTING; WOODCUTTING;
// boolean issueWarning = true;
/*
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
* Everything below here will be removed in 2.2 (Tridents & Crossbows)
*/
// private void processWarning() {
// if(issueWarning) {
// StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
// Bukkit.getScheduler().scheduleSyncDelayedTask(mcMMO.p, () -> {
// mcMMO.p.getLogger().severe("A plugin that hooks into mcMMO via the mcMMO API is using soon to be deprecated API calls. Contact the plugin author and inform them to update their code before it breaks.");
// mcMMO.p.getLogger().severe("Deprecation Call from: " + stackTraceElements[2].toString());
// mcMMO.p.getLogger().severe("This warning will not repeat itself. Nothing is broken for now, but in the future it will be.");
// });
//
// issueWarning = !issueWarning;
// }
// }
/** /**
* WARNING: Being removed in an upcoming update, you should be using mcMMO.getSkillTools() instead * WARNING: Being removed in an upcoming update, you should be using mcMMO.getSkillTools() instead

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.skills.mining; package com.gmail.nossr50.skills.mining;
import com.gmail.nossr50.api.ItemSpawnReason; import com.gmail.nossr50.api.ItemSpawnReason;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.interactions.NotificationType;
@ -188,7 +189,7 @@ public class MiningManager extends SkillManager {
Misc.spawnItem(getPlayer(), Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()), ItemSpawnReason.BLAST_MINING_ORES); // Initial block that would have been dropped Misc.spawnItem(getPlayer(), Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()), ItemSpawnReason.BLAST_MINING_ORES); // Initial block that would have been dropped
if (!mcMMO.getPlaceStore().isTrue(blockState)) { if (mcMMO.p.getAdvancedConfig().isBlastMiningBonusDropsEnabled() && !mcMMO.getPlaceStore().isTrue(blockState)) {
for (int i = 1; i < dropMultiplier; i++) { for (int i = 1; i < dropMultiplier; i++) {
// Bukkit.broadcastMessage("Bonus Drop on Ore: "+blockState.getType().toString()); // Bukkit.broadcastMessage("Bonus Drop on Ore: "+blockState.getType().toString());
Misc.spawnItem(getPlayer(), Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()), ItemSpawnReason.BLAST_MINING_ORES_BONUS_DROP); // Initial block that would have been dropped Misc.spawnItem(getPlayer(), Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()), ItemSpawnReason.BLAST_MINING_ORES_BONUS_DROP); // Initial block that would have been dropped
@ -275,21 +276,16 @@ public class MiningManager extends SkillManager {
* @return the Blast Mining tier * @return the Blast Mining tier
*/ */
public int getDropMultiplier() { public int getDropMultiplier() {
switch(getBlastMiningTier()) { if (mcMMO.p.getAdvancedConfig().isBlastMiningBonusDropsEnabled()) {
case 8:
case 7:
return 3;
case 6:
case 5:
case 4:
case 3:
return 2;
case 2:
case 1:
return 1;
default:
return 0; return 0;
} }
return switch (getBlastMiningTier()) {
case 8, 7 -> 3;
case 6, 5, 4, 3 -> 2;
case 2, 1 -> 1;
default -> 0;
};
} }
/** /**

View File

@ -289,6 +289,8 @@ Skills:
RetroMode: 1000 RetroMode: 1000
BlastMining: BlastMining:
Bonus_Drops:
Enabled: true
# BlastDamageDecrease Ranks: % of damage reduced from TNT explosions # BlastDamageDecrease Ranks: % of damage reduced from TNT explosions
BlastDamageDecrease: BlastDamageDecrease:
Rank_1: 0.0 Rank_1: 0.0