This commit is contained in:
nossr50 2020-09-28 17:36:33 -07:00
parent 8451f84083
commit 4005c21810
3 changed files with 12 additions and 10 deletions

View File

@ -1,5 +1,5 @@
Version 2.1.147 Version 2.1.147
Fixed a bug where players below the level threshold on a hardcore mode enabled server would gain levels on death in certain circumstances
Version 2.1.146 Version 2.1.146
A bug where players would disconnect from mcMMO messages has been fixed (thanks kashike / read notes) A bug where players would disconnect from mcMMO messages has been fixed (thanks kashike / read notes)

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.147-SNAPSHOT</version> <version>2.1.147</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

@ -331,8 +331,9 @@ public class EventUtils {
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
String skillName = primarySkillType.toString(); String skillName = primarySkillType.toString();
int playerSkillLevel = playerProfile.getSkillLevel(primarySkillType); int playerSkillLevel = playerProfile.getSkillLevel(primarySkillType);
int threshold = Config.getInstance().getHardcoreDeathStatPenaltyLevelThreshold();
playerProfile.modifySkill(primarySkillType, Math.max(Config.getInstance().getHardcoreDeathStatPenaltyLevelThreshold(), playerSkillLevel - levelChanged.get(skillName))); if(playerSkillLevel > threshold) {
playerProfile.modifySkill(primarySkillType, Math.max(threshold, playerSkillLevel - levelChanged.get(skillName)));
playerProfile.removeXp(primarySkillType, experienceChanged.get(skillName)); playerProfile.removeXp(primarySkillType, experienceChanged.get(skillName));
if (playerProfile.getSkillXpLevel(primarySkillType) < 0) { if (playerProfile.getSkillXpLevel(primarySkillType) < 0) {
@ -344,6 +345,7 @@ public class EventUtils {
} }
} }
} }
}
return !isCancelled; return !isCancelled;
} }