浏览代码

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

nossr50 6 年之前
父节点
当前提交
321684e5f6
共有 3 个文件被更改,包括 8 次插入2 次删除
  1. 3 0
      Changelog.txt
  2. 1 1
      pom.xml
  3. 4 1
      src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java

+ 3 - 0
Changelog.txt

@@ -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)

+ 1 - 1
pom.xml

@@ -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>

+ 4 - 1
src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java

@@ -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;
         }