Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable

This commit is contained in:
nossr50 2019-06-20 00:09:50 -07:00
commit 55609249ed
4 changed files with 22 additions and 9 deletions

View File

@ -194,6 +194,13 @@ Version 2.2.0
Added API method to grab the level cap of a skill by its PrimarySkillType ENUM definition
Added API method to check if a skill was being level capped
Added 'UndefinedSkillBehaviour' for trying to use a method that has no behaviour defined for the provided skill
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

View File

@ -112,21 +112,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) {
mcMMO.getNotificationManager().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) {
mcMMO.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Normal", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
} else {
mcMMO.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Untrained", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));

View File

@ -10,6 +10,7 @@ import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
import com.gmail.nossr50.listeners.InteractionManager;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.skills.SkillUnlockNotificationTask;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.reflect.TypeToken;
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
@ -39,6 +40,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)) {
SkillUnlockNotificationTask skillUnlockNotificationTask = new SkillUnlockNotificationTask(mcMMOPlayer, subSkillType, newLevel);

View File

@ -445,6 +445,7 @@ permissions:
description: Allows access to all Repair abilities
children:
mcmmo.ability.repair.arcaneforging: true
mcmmo.ability.repair.superrepair: true
mcmmo.ability.repair.repairbonus: true
mcmmo.ability.repair.repairmastery: true
mcmmo.ability.repair.arcaneforging:
@ -461,10 +462,10 @@ 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.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.smelting.*: