From 5698d8282c41a149bee39446d2a011889af6b193 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 20 Jun 2019 00:02:48 -0700 Subject: [PATCH] 2.1.85 --- Changelog.txt | 7 +++++++ pom.xml | 2 +- .../gmail/nossr50/skills/salvage/SalvageManager.java | 12 ++++++------ .../com/gmail/nossr50/util/skills/RankUtils.java | 5 +++++ src/main/resources/plugin.yml | 7 ++++--- 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 5480c1e3a..803e8ffc5 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,10 @@ +Version 2.1.85 + Fixed a nearly 6 year old bug where Super Repair was not included as a child permission under Repair ability permission nodes (which meant some players would not have access to this skill) + Fixed a bug that could prevent salvage from working for certain players + Renamed the advanced salvage permission node to 'mcmmo.ability.salvage.scrapcollector' + Fixed a bug that would send players skill unlock notifications if they did not have the permission node for that skill + Dramatically increased the chance of receiving full materials when salvaging + Version 2.1.84 Added some code to make mcMMO more compatible with EpicSpawners diff --git a/pom.xml b/pom.xml index 2b03a980b..554065870 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.84 + 2.1.85 mcMMO https://github.com/mcMMO-Dev/mcMMO diff --git a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java index e7fd5bb44..d7e10de68 100644 --- a/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java +++ b/src/main/java/com/gmail/nossr50/skills/salvage/SalvageManager.java @@ -115,21 +115,21 @@ public class SalvageManager extends SkillManager { //Lottery on Salvageable Amount int lotteryResults = 1; - int chanceOfSuccess = 80; + int chanceOfSuccess = 99; - for(int x = 1; x < salvageableAmount-1; x++) { + for(int x = 0; x < salvageableAmount-1; x++) { if(RandomChanceUtil.rollDice(chanceOfSuccess, 100)) { - chanceOfSuccess-=20; - Math.max(chanceOfSuccess, 33); + chanceOfSuccess-=2; + Math.max(chanceOfSuccess, 95); lotteryResults+=1; } } - if(lotteryResults == salvageableAmount) { + if(lotteryResults == salvageableAmount && salvageableAmount != 1) { NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Perfect", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType())); - } else if(RankUtils.isPlayerMaxRankInSubSkill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE)) { + } else if(RankUtils.isPlayerMaxRankInSubSkill(player, SubSkillType.SALVAGE_ARCANE_SALVAGE) || salvageableAmount == 1) { NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Normal", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType())); } else { NotificationManager.sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Untrained", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType())); diff --git a/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java b/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java index 60d54250f..2806dd91a 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/RankUtils.java @@ -8,6 +8,7 @@ import com.gmail.nossr50.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill; import com.gmail.nossr50.listeners.InteractionManager; import com.gmail.nossr50.runnables.skills.SkillUnlockNotificationTask; +import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.player.UserManager; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; @@ -37,6 +38,10 @@ public class RankUtils { if(innerMap == null || innerMap.get(playerRankInSkill) == null) continue; + //Don't send notifications if the player lacks the permission node + if(!Permissions.isSubSkillEnabled(mcMMOPlayer.getPlayer(), subSkillType)) + continue; + //The players level is the exact level requirement for this skill if(newLevel == innerMap.get(playerRankInSkill)) { diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 323a68f54..ae9061bcc 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -454,6 +454,7 @@ permissions: description: Allows access to all Repair abilities children: mcmmo.ability.repair.arcaneforging: true + mcmmo.ability.repair.superrepair: true mcmmo.ability.repair.armorrepair: true mcmmo.ability.repair.diamondrepair: true mcmmo.ability.repair.goldrepair: true @@ -503,7 +504,7 @@ permissions: mcmmo.ability.salvage.all: description: Allows access to all Smelting abilities children: - mcmmo.ability.salvage.advancedsalvage: true + mcmmo.ability.salvage.scrapcollector: true mcmmo.ability.salvage.arcanesalvage: true mcmmo.ability.salvage.armorsalvage: true mcmmo.ability.salvage.diamondsalvage: true @@ -516,8 +517,8 @@ permissions: mcmmo.ability.salvage.stringsalvage: true mcmmo.ability.salvage.toolsalvage: true mcmmo.ability.salvage.woodsalvage: true - mcmmo.ability.salvage.advancedsalvage: - description: Allows access to the Advanced Salvage ability + mcmmo.ability.salvage.scrapcollector: + description: Allows access to the Scrap Collector ability mcmmo.ability.salvage.arcanesalvage: description: Allows access to the Arcane Salvage ability mcmmo.ability.salvage.armorsalvage: