From 22a738bace1832d9e5b744716c6e7d72f7844e71 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 16 Dec 2020 16:15:19 -0800 Subject: [PATCH] mcMMO no longer throws errors on below 0 xp gains Fixes #4346 --- Changelog.txt | 5 +++++ .../java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java | 4 +--- .../nossr50/runnables/database/UUIDUpdateAsyncTask.java | 1 + src/main/resources/upgrades.yml | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 43ba29e19..c15166fcd 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,11 @@ Version 2.1.163 Fixed the translate URL pointing to the wrong place (thanks chew) + Fixed a bug where FlatFile databases would always attempt a UUID conversion task every save operation (every 10 minutes) causing console spam + mcMMO will no longer throw errors when incoming XP is below 0 (it will just silently cancel the operation) + NOTES: + I often test in SQL environments so I missed this bug, reminder to come bother me on discord if you find any annoying bugs! + Also work on T&C is going great lately, I feel great. Perhaps my depression is getting better! Version 2.1.162 Fixed a bug where Alchemy brew events were processed after setting brew results (thanks Wolf2323) diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index 99830d0ba..7ae9861a9 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -545,9 +545,7 @@ public class McMMOPlayer implements Identified { * @param xp Experience amount to process */ public void beginXpGain(PrimarySkillType skill, float xp, XPGainReason xpGainReason, XPGainSource xpGainSource) { - Validate.isTrue(xp >= 0.0, "XP gained should be greater than or equal to zero."); - - if (xp <= 0.0) { + if(xp <= 0) { return; } diff --git a/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java b/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java index 6c2c13822..fe87185aa 100644 --- a/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/database/UUIDUpdateAsyncTask.java @@ -102,6 +102,7 @@ public class UUIDUpdateAsyncTask implements Runnable { if (position == userNames.size()) { mcMMO.getUpgradeManager().setUpgradeCompleted(UpgradeType.ADD_UUIDS); awaiter.countDown(); + plugin.getLogger().info("UUID checks completed"); } else this.runTaskLaterAsynchronously(plugin, Misc.TICK_CONVERSION_FACTOR * DELAY_PERIOD); // Schedule next batch } diff --git a/src/main/resources/upgrades.yml b/src/main/resources/upgrades.yml index 7e392e7f0..3a60fb42c 100644 --- a/src/main/resources/upgrades.yml +++ b/src/main/resources/upgrades.yml @@ -10,3 +10,4 @@ Upgrades_Finished: FIX_SPELLING_NETHERITE_SALVAGE: false FIX_SPELLING_NETHERITE_REPAIR: false FIX_NETHERITE_SALVAGE_QUANTITIES: false + ADD_UUIDS: false