mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Hardcore mode won't bring players below level threshold anymore
This commit is contained in:
parent
621ccfed34
commit
3badc26806
@ -1,3 +1,7 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
2
pom.xml
2
pom.xml
@ -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.145</version>
|
<version>2.1.146-SNAPSHOT</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>
|
||||||
|
@ -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;
|
||||||
@ -330,7 +332,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) {
|
||||||
|
@ -50,7 +50,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);
|
||||||
|
Loading…
Reference in New Issue
Block a user