From 439a69cc5bbf821d7c24eb15e6dca6eb19ade0b3 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 9 Dec 2020 19:16:58 -0800 Subject: [PATCH 01/11] normalize pom --- pom.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index cb1fc2630..060d22fbe 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.160 + 2.1.161-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO @@ -120,6 +120,10 @@ + + net.kyori.adventure + com.gmail.nossr50.mcmmo.kyori.adventure + co.aikar.commands com.gmail.nossr50.mcmmo.acf @@ -140,10 +144,6 @@ org.apache.tomcat com.gmail.nossr50.mcmmo.database.tomcat - - net.kyori.adventure - com.gmail.nossr50.mcmmo.kyori.adventure - org.bstats com.gmail.nossr50.mcmmo.metrics.bstat @@ -202,17 +202,17 @@ net.kyori adventure-text-serializer-gson - 4.3.0-SNAPSHOT + 4.3.0 net.kyori adventure-api - 4.2.0 + 4.3.0 net.kyori adventure-nbt - 4.2.0-SNAPSHOT + 4.3.0 net.kyori From b7cf84299ab963f5d6a0d95e6f5085610ff53864 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 9 Dec 2020 19:51:57 -0800 Subject: [PATCH 02/11] add missing adventure modules --- pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index 060d22fbe..94d06526d 100755 --- a/pom.xml +++ b/pom.xml @@ -115,6 +115,7 @@ net.kyori:adventure-text-serializer-legacy net.kyori:adventure-text-serializer-bungeecord net.kyori:adventure-text-serializer-craftbukkit + net.kyori:adventure-text-serializer-gson-legacy-impl co.aikar:acf-bukkit @@ -229,6 +230,11 @@ adventure-platform-common 4.0.0-SNAPSHOT + + net.kyori + adventure-text-serializer-gson-legacy-impl + 4.3.0 + org.apache.maven.scm maven-scm-provider-gitexe From c4072ee90d560ff0da07eedc9be866353da002d6 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 9 Dec 2020 19:58:20 -0800 Subject: [PATCH 03/11] 2.1.161 - Messages fixed! --- Changelog.txt | 5 +++++ pom.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 67f252785..64b09b933 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,8 @@ +Version 2.1.161 + Fixed a bug where a bunch of text from mcMMO was never being sent and or being sent as blank messages + + NOTES: + Adventure (the chat library we use) had an update that required shading in another new module, but there were no errors thrown without running a jvm debug flag and testing it, which is why I missed it. I also missed it because I don't read update notes very closely Version 2.1.160 Fixed another 9+ year old exploit Silenced a harmless "error" related to Rupture/Bleed often produced when using mcMMO and crazy enchantments together diff --git a/pom.xml b/pom.xml index 94d06526d..31cef8065 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.161-SNAPSHOT + 2.1.161 mcMMO https://github.com/mcMMO-Dev/mcMMO From 0e09ac397d0e835a134c5aaeb97cb8f8fe932881 Mon Sep 17 00:00:00 2001 From: Wolf2323 Date: Thu, 10 Dec 2020 22:24:08 +0100 Subject: [PATCH 04/11] fix BrewingStand inventory is updated immediately instead of after firing the event. Now the event can be canceled correct. (#4351) --- .../nossr50/skills/alchemy/AlchemyPotionBrewer.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java b/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java index f42584b25..8b9f9ae36 100644 --- a/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java +++ b/src/main/java/com/gmail/nossr50/skills/alchemy/AlchemyPotionBrewer.java @@ -114,6 +114,7 @@ public final class AlchemyPotionBrewer { } List inputList = new ArrayList<>(); + ItemStack[] outputList = new ItemStack[3]; for (int i = 0; i < 3; i++) { ItemStack item = inventory.getItem(i); @@ -128,7 +129,7 @@ public final class AlchemyPotionBrewer { inputList.add(input); if (output != null) { - inventory.setItem(i, output.toItemStack(item.getAmount()).clone()); + outputList[i] = output.toItemStack(item.getAmount()).clone(); } } @@ -139,6 +140,12 @@ public final class AlchemyPotionBrewer { return; } + for (int i = 0; i < 3; i++) { + if(outputList[i] != null) { + inventory.setItem(i, outputList[i]); + } + } + removeIngredient(inventory, player); for (AlchemyPotion input : inputList) { From bb37edaa7f0509ccab1e4d932c2020bd026f96f5 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 14 Dec 2020 15:21:48 -0800 Subject: [PATCH 05/11] update changelog --- Changelog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index 64b09b933..7e7a19322 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,6 @@ +Version 2.1.162 + Fixed a bug where Alchemy brew events were processed after setting brew results (thanks Wolf2323) + Version 2.1.161 Fixed a bug where a bunch of text from mcMMO was never being sent and or being sent as blank messages From 58e634e53a5b01bace5e0a574108adde4bdf6184 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 14 Dec 2020 15:22:09 -0800 Subject: [PATCH 06/11] dev mode --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 31cef8065..00739f6cc 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.161 + 2.1.162-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO From 16aa6d65ac78971bdd9889d0c8c0458f0b8babeb Mon Sep 17 00:00:00 2001 From: Robert Alan Chapton Date: Wed, 16 Dec 2020 12:46:17 -0800 Subject: [PATCH 07/11] Update McMMOUrl.java fixed translate link, thanks chew --- src/main/java/com/gmail/nossr50/datatypes/json/McMMOUrl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/datatypes/json/McMMOUrl.java b/src/main/java/com/gmail/nossr50/datatypes/json/McMMOUrl.java index 4f4886aeb..8d9d4e634 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/json/McMMOUrl.java +++ b/src/main/java/com/gmail/nossr50/datatypes/json/McMMOUrl.java @@ -6,7 +6,7 @@ public class McMMOUrl { public static final String urlPatreon = "https://www.patreon.com/nossr50"; public static final String urlWiki = "https://www.mcmmo.org/wiki/"; public static final String urlSpigot = "http://spigot.mcmmo.org"; - public static final String urlTranslate = "https://www.mcmmo.org/translate/"; + public static final String urlTranslate = "https://translate.mcmmo.org/"; public static String getUrl(McMMOWebLinks webLinks) { From dfc2691cd65a7d6ae007fc4a51eeacbad732bee6 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 16 Dec 2020 15:55:54 -0800 Subject: [PATCH 08/11] dev mode and changelog update --- Changelog.txt | 4 ++++ pom.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 7e7a19322..43ba29e19 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,7 @@ +Version 2.1.163 + Fixed the translate URL pointing to the wrong place (thanks chew) + + Version 2.1.162 Fixed a bug where Alchemy brew events were processed after setting brew results (thanks Wolf2323) diff --git a/pom.xml b/pom.xml index 00739f6cc..e6c2c9896 100755 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.gmail.nossr50.mcMMO mcMMO - 2.1.162-SNAPSHOT + 2.1.163-SNAPSHOT mcMMO https://github.com/mcMMO-Dev/mcMMO From 22a738bace1832d9e5b744716c6e7d72f7844e71 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 16 Dec 2020 16:15:19 -0800 Subject: [PATCH 09/11] 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 From 8c52884ac685a73f787ca3c461454feeeca8afcf Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 16 Dec 2020 16:29:05 -0800 Subject: [PATCH 10/11] Remove COTW entities on chunk unload Fixes #4289 --- Changelog.txt | 1 + .../nossr50/listeners/ChunkListener.java | 30 +++++++++++++++++++ .../nossr50/skills/taming/TamingManager.java | 1 + 3 files changed, 32 insertions(+) create mode 100644 src/main/java/com/gmail/nossr50/listeners/ChunkListener.java diff --git a/Changelog.txt b/Changelog.txt index c15166fcd..f2a7d129e 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -2,6 +2,7 @@ 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) + COTW Summoned entities are now removed when the chunk they are in is unloaded (prevents some exploits) 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! diff --git a/src/main/java/com/gmail/nossr50/listeners/ChunkListener.java b/src/main/java/com/gmail/nossr50/listeners/ChunkListener.java new file mode 100644 index 000000000..406a02436 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/listeners/ChunkListener.java @@ -0,0 +1,30 @@ +package com.gmail.nossr50.listeners; + +import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.util.compat.layers.persistentdata.MobMetaFlagType; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.world.ChunkUnloadEvent; + +public class ChunkListener implements Listener { + + @EventHandler(ignoreCancelled = true) + public void onChunkUnload(ChunkUnloadEvent event) { + for(Entity entity : event.getChunk().getEntities()) { + if(entity instanceof LivingEntity) { + LivingEntity livingEntity = (LivingEntity) entity; + if(mcMMO.getCompatibilityManager().getPersistentDataLayer().hasMobFlag(MobMetaFlagType.COTW_SUMMONED_MOB, livingEntity)) { + + //Remove from existence + if(livingEntity.isValid()) { + mcMMO.getCompatibilityManager().getPersistentDataLayer().removeMobFlags(livingEntity); + livingEntity.setHealth(0); + livingEntity.remove(); + } + } + } + } + } +} diff --git a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java index 64c2e8f16..3fce43f26 100644 --- a/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/taming/TamingManager.java @@ -570,6 +570,7 @@ public class TamingManager extends SkillManager { //Remove from existence if(livingEntity != null && livingEntity.isValid()) { + mcMMO.getCompatibilityManager().getPersistentDataLayer().removeMobFlags(livingEntity); livingEntity.setHealth(0); livingEntity.remove(); } From 2de52c79550ccc8f37aa0545b7496b2e85007041 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 16 Dec 2020 16:30:05 -0800 Subject: [PATCH 11/11] register new chunk listener --- src/main/java/com/gmail/nossr50/mcMMO.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 7649eb114..15314c693 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -567,6 +567,7 @@ public class mcMMO extends JavaPlugin { pluginManager.registerEvents(new InventoryListener(this), this); pluginManager.registerEvents(new SelfListener(this), this); pluginManager.registerEvents(new WorldListener(this), this); + pluginManager.registerEvents(new ChunkListener(), this); // pluginManager.registerEvents(new CommandListener(this), this); }