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 4fc0160ac6..7a408e83fc 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/MinecraftVersion.java @@ -55,6 +55,12 @@ public enum MinecraftVersion { */ MINECRAFT_1_20_5(20, 5, "1.20.5+"), + /** + * This constant represents Minecraft (Java Edition) Version 1.21 + * ("Tricky Trials") + */ + MINECRAFT_1_21(21, 0, "1.21+"), + /** * This constant represents an exceptional state in which we were unable * to identify the Minecraft Version we are using diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java index dbd8f34a4d..58e3c676f5 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/tools/ExplosiveTool.java @@ -9,6 +9,7 @@ import javax.annotation.ParametersAreNonnullByDefault; import dev.lone.itemsadder.api.CustomBlock; +import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion; import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.ExplosionResult; @@ -194,9 +195,9 @@ private BlockExplodeEvent createNewBlockExplodeEvent( List blocks, float yield ) { - String[] version = Bukkit.getBukkitVersion().split("-"); - if (Integer.parseInt(version[1]) >= 21) { + var version = Slimefun.getMinecraftVersion(); + if (version.isAtLeast(MinecraftVersion.MINECRAFT_1_21)) { return new BlockExplodeEvent(block, block.getState(), blocks, yield, ExplosionResult.DESTROY); } else { try {