From 47c1174dc336df8d71e70d1e494421df00efdbb7 Mon Sep 17 00:00:00 2001 From: Ddggdd135 <1306334428@qq.com> Date: Sun, 25 Aug 2024 21:45:21 +0800 Subject: [PATCH 1/3] fix(VanillaCrafterListener): check version --- .../thebusybiscuit/slimefun4/api/MinecraftVersion.java | 5 +++++ .../listeners/crafting/VanillaCrafterListener.java | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index c561d30786..c3cbbad331 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -44,6 +44,11 @@ public enum MinecraftVersion { * ("The Trails & Tales Update") */ MINECRAFT_1_20(20, "1.20.x"), + /** + * This constant represents Minecraft (Java Edition) Version 1.20.4 + * (a hotfix release) + */ + MINECRAFT_1_20_4(20, 4, "1.20.4+"), /** * This constant represents Minecraft (Java Edition) Version 1.20.5 diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/crafting/VanillaCrafterListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/crafting/VanillaCrafterListener.java index dbf1fa8065..1a93f46024 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/crafting/VanillaCrafterListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/crafting/VanillaCrafterListener.java @@ -1,6 +1,7 @@ package io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting; import city.norain.slimefun4.compatibillty.VersionedEvent; +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import javax.annotation.Nonnull; @@ -16,7 +17,8 @@ public class VanillaCrafterListener implements SlimefunCraftingListener { public VanillaCrafterListener(@Nonnull Slimefun plugin) { - plugin.getServer().getPluginManager().registerEvents(this, plugin); + if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_20_4)) + plugin.getServer().getPluginManager().registerEvents(this, plugin); } @EventHandler(ignoreCancelled = true) From b73a6ee9643b8411736ff022f072b7b5aaa37f78 Mon Sep 17 00:00:00 2001 From: Ddggdd135 <1306334428@qq.com> Date: Sun, 25 Aug 2024 22:19:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BD=BF=E7=94=A8SlimefunExtended=E4=B8=AD?= =?UTF-8?q?=E7=9A=84MinecraftVersion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../listeners/crafting/VanillaCrafterListener.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/crafting/VanillaCrafterListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/crafting/VanillaCrafterListener.java index 1a93f46024..0b1b7f278a 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/crafting/VanillaCrafterListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/crafting/VanillaCrafterListener.java @@ -1,7 +1,8 @@ package io.github.thebusybiscuit.slimefun4.implementation.listeners.crafting; +import city.norain.slimefun4.SlimefunExtended; import city.norain.slimefun4.compatibillty.VersionedEvent; -import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; +import io.github.bakedlibs.dough.versions.MinecraftVersion; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import javax.annotation.Nonnull; @@ -17,7 +18,7 @@ public class VanillaCrafterListener implements SlimefunCraftingListener { public VanillaCrafterListener(@Nonnull Slimefun plugin) { - if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_20_4)) + if (SlimefunExtended.getMinecraftVersion().isAtLeast(MinecraftVersion.parse("1.20.3"))) plugin.getServer().getPluginManager().registerEvents(this, plugin); } From d41449424228aa2756d75668a722b59bde838666 Mon Sep 17 00:00:00 2001 From: Ddggdd135 <1306334428@qq.com> Date: Sun, 25 Aug 2024 22:20:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=A7=BB=E9=99=A41.20.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thebusybiscuit/slimefun4/api/MinecraftVersion.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java index c3cbbad331..c561d30786 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -44,11 +44,6 @@ public enum MinecraftVersion { * ("The Trails & Tales Update") */ MINECRAFT_1_20(20, "1.20.x"), - /** - * This constant represents Minecraft (Java Edition) Version 1.20.4 - * (a hotfix release) - */ - MINECRAFT_1_20_4(20, 4, "1.20.4+"), /** * This constant represents Minecraft (Java Edition) Version 1.20.5