Fixed a bug where creative players could gain XP if they qualified for

early game XP boosts
This commit is contained in:
nossr50 2019-05-19 17:34:51 -07:00
parent 0b247dfae7
commit 321684e5f6
3 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,6 @@
Version 2.1.63
Fixed a bug that caused creative mode players to gain XP when qualifying for early game XP boosts
Version 2.1.62
Added a new admin notification system, sensitive commands will print chat messages to "admins" (players with either Operator status or admin chat permission)
Added a setting to disable the new admin notifications to config.yml 'General.AdminNotifications' (this will be more configurable in 2.2)

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.62</version>
<version>2.1.63-SNAPSHOT</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>

View File

@ -495,6 +495,9 @@ public class McMMOPlayer {
* @param xp Experience amount to process
*/
public void beginUnsharedXpGain(PrimarySkillType skill, float xp, XPGainReason xpGainReason, XPGainSource xpGainSource) {
if(player.getGameMode() == GameMode.CREATIVE)
return;
applyXpGain(skill, modifyXpGain(skill, xp), xpGainReason, xpGainSource);
if (party == null) {
@ -750,7 +753,7 @@ public class McMMOPlayer {
* @return Modified experience
*/
private float modifyXpGain(PrimarySkillType primarySkillType, float xp) {
if (player.getGameMode() == GameMode.CREATIVE || (primarySkillType.getMaxLevel() <= getSkillLevel(primarySkillType)) || (Config.getInstance().getPowerLevelCap() <= getPowerLevel())) {
if ((primarySkillType.getMaxLevel() <= getSkillLevel(primarySkillType)) || (Config.getInstance().getPowerLevelCap() <= getPowerLevel())) {
return 0;
}