浏览代码

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

nossr50 4 年之前
父节点
当前提交
6f6f76532e

+ 3 - 0
Changelog.txt

@@ -84,6 +84,9 @@ Version 2.2.000
     Parties got unnecessarily complex in my absence, I have removed many party features in order to simplify parties and bring them closer to my vision. I have also added new features which should improve parties where it matters.
     Parties got unnecessarily complex in my absence, I have removed many party features in order to simplify parties and bring them closer to my vision. I have also added new features which should improve parties where it matters.
     About the removed party features, all the features I removed I consider poor quality features and I don't think they belong in mcMMO. Feel free to yell at me in discord if you disagree.
     About the removed party features, all the features I removed I consider poor quality features and I don't think they belong in mcMMO. Feel free to yell at me in discord if you disagree.
     I don't know what genius decided to make parties public by default, when I found out that parties had been changed to such a system I could barely contain my disgust. Parties are back to being private, you get invited by a party leader or party officer. That is the only way to join a party.
     I don't know what genius decided to make parties public by default, when I found out that parties had been changed to such a system I could barely contain my disgust. Parties are back to being private, you get invited by a party leader or party officer. That is the only way to join a party.
+Version 2.1.146
+    Players no longer lose levels below the level threshold in hardcore mode
+    Hardcore now only applies penalties to levels above threshold
 
 
 Version 2.1.145
 Version 2.1.145
     Reverted 'Changed one of the PlayerInteractEvent listeners to ignore cancelled events' from 2.1.144
     Reverted 'Changed one of the PlayerInteractEvent listeners to ignore cancelled events' from 2.1.144

+ 3 - 1
src/main/java/com/gmail/nossr50/util/EventUtils.java

@@ -1,5 +1,7 @@
 package com.gmail.nossr50.util;
 package com.gmail.nossr50.util;
 
 
+import com.gmail.nossr50.config.AdvancedConfig;
+import com.gmail.nossr50.config.Config;
 import com.gmail.nossr50.datatypes.experience.XPGainReason;
 import com.gmail.nossr50.datatypes.experience.XPGainReason;
 import com.gmail.nossr50.datatypes.experience.XPGainSource;
 import com.gmail.nossr50.datatypes.experience.XPGainSource;
 import com.gmail.nossr50.datatypes.party.Party;
 import com.gmail.nossr50.datatypes.party.Party;
@@ -329,7 +331,7 @@ public class EventUtils {
                 String skillName = primarySkillType.toString();
                 String skillName = primarySkillType.toString();
                 int playerSkillLevel = playerProfile.getSkillLevel(primarySkillType);
                 int playerSkillLevel = playerProfile.getSkillLevel(primarySkillType);
 
 
-                playerProfile.modifySkill(primarySkillType, playerSkillLevel - levelChanged.get(skillName));
+                playerProfile.modifySkill(primarySkillType, Math.max(Config.getInstance().getHardcoreDeathStatPenaltyLevelThreshold(), 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) {

+ 1 - 1
src/main/java/com/gmail/nossr50/util/HardcoreManager.java

@@ -49,7 +49,7 @@ public final class HardcoreManager {
                 continue;
                 continue;
             }
             }
 
 
-            double statsLost = playerSkillLevel * (statLossPercentage * 0.01D);
+            double statsLost = Math.max(0, (playerSkillLevel - levelThreshold)) * (statLossPercentage * 0.01D);
             int levelsLost = (int) statsLost;
             int levelsLost = (int) statsLost;
             int xpLost = (int) Math.floor(playerSkillXpLevel * (statsLost - levelsLost));
             int xpLost = (int) Math.floor(playerSkillXpLevel * (statsLost - levelsLost));
             levelChanged.put(primarySkillType.toString(), levelsLost);
             levelChanged.put(primarySkillType.toString(), levelsLost);