mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 16:19:53 +01:00
Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable
This commit is contained in:
commit
55609249ed
@ -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 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 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
|
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
|
Version 2.1.84
|
||||||
Added some code to make mcMMO more compatible with EpicSpawners
|
Added some code to make mcMMO more compatible with EpicSpawners
|
||||||
|
|
||||||
|
@ -112,21 +112,21 @@ public class SalvageManager extends SkillManager {
|
|||||||
//Lottery on Salvageable Amount
|
//Lottery on Salvageable Amount
|
||||||
|
|
||||||
int lotteryResults = 1;
|
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)) {
|
if(RandomChanceUtil.rollDice(chanceOfSuccess, 100)) {
|
||||||
chanceOfSuccess-=20;
|
chanceOfSuccess-=2;
|
||||||
Math.max(chanceOfSuccess, 33);
|
Math.max(chanceOfSuccess, 95);
|
||||||
|
|
||||||
lotteryResults+=1;
|
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()));
|
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()));
|
mcMMO.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Normal", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||||
} else {
|
} else {
|
||||||
mcMMO.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Untrained", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
mcMMO.getNotificationManager().sendPlayerInformationChatOnly(player, "Salvage.Skills.Lottery.Untrained", String.valueOf(lotteryResults), StringUtils.getPrettyItemString(item.getType()));
|
||||||
|
@ -10,6 +10,7 @@ import com.gmail.nossr50.datatypes.skills.subskills.AbstractSubSkill;
|
|||||||
import com.gmail.nossr50.listeners.InteractionManager;
|
import com.gmail.nossr50.listeners.InteractionManager;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.runnables.skills.SkillUnlockNotificationTask;
|
import com.gmail.nossr50.runnables.skills.SkillUnlockNotificationTask;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
import com.gmail.nossr50.util.player.UserManager;
|
import com.gmail.nossr50.util.player.UserManager;
|
||||||
import com.google.common.reflect.TypeToken;
|
import com.google.common.reflect.TypeToken;
|
||||||
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
|
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
|
||||||
@ -39,6 +40,10 @@ public class RankUtils {
|
|||||||
if (innerMap == null || innerMap.get(playerRankInSkill) == null)
|
if (innerMap == null || innerMap.get(playerRankInSkill) == null)
|
||||||
continue;
|
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
|
//The players level is the exact level requirement for this skill
|
||||||
if (newLevel == innerMap.get(playerRankInSkill)) {
|
if (newLevel == innerMap.get(playerRankInSkill)) {
|
||||||
SkillUnlockNotificationTask skillUnlockNotificationTask = new SkillUnlockNotificationTask(mcMMOPlayer, subSkillType, newLevel);
|
SkillUnlockNotificationTask skillUnlockNotificationTask = new SkillUnlockNotificationTask(mcMMOPlayer, subSkillType, newLevel);
|
||||||
|
@ -445,6 +445,7 @@ permissions:
|
|||||||
description: Allows access to all Repair abilities
|
description: Allows access to all Repair abilities
|
||||||
children:
|
children:
|
||||||
mcmmo.ability.repair.arcaneforging: true
|
mcmmo.ability.repair.arcaneforging: true
|
||||||
|
mcmmo.ability.repair.superrepair: true
|
||||||
mcmmo.ability.repair.repairbonus: true
|
mcmmo.ability.repair.repairbonus: true
|
||||||
mcmmo.ability.repair.repairmastery: true
|
mcmmo.ability.repair.repairmastery: true
|
||||||
mcmmo.ability.repair.arcaneforging:
|
mcmmo.ability.repair.arcaneforging:
|
||||||
@ -461,10 +462,10 @@ permissions:
|
|||||||
mcmmo.ability.salvage.all:
|
mcmmo.ability.salvage.all:
|
||||||
description: Allows access to all Smelting abilities
|
description: Allows access to all Smelting abilities
|
||||||
children:
|
children:
|
||||||
mcmmo.ability.salvage.advancedsalvage: true
|
mcmmo.ability.salvage.scrapcollector: true
|
||||||
mcmmo.ability.salvage.arcanesalvage: true
|
mcmmo.ability.salvage.arcanesalvage: true
|
||||||
mcmmo.ability.salvage.advancedsalvage:
|
mcmmo.ability.salvage.scrapcollector:
|
||||||
description: Allows access to the Advanced Salvage ability
|
description: Allows access to the Scrap Collector ability
|
||||||
mcmmo.ability.salvage.arcanesalvage:
|
mcmmo.ability.salvage.arcanesalvage:
|
||||||
description: Allows access to the Arcane Salvage ability
|
description: Allows access to the Arcane Salvage ability
|
||||||
mcmmo.ability.smelting.*:
|
mcmmo.ability.smelting.*:
|
||||||
|
Loading…
Reference in New Issue
Block a user