Skip to content

Commit

Permalink
Update Slimefun.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Aug 7, 2024
1 parent 6b11ee2 commit 0ec914b
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.MenuListener;
import me.qscbm.slimefun4.services.LanguageService;
import me.qscbm.slimefun4.tasks.CargoTickerTask;
import me.qscbm.slimefun4.utils.VersionUtils;
import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.World;
Expand Down Expand Up @@ -154,7 +155,19 @@ public void onEnable() {
return;
}
initialized = true;

int version = VersionUtils.getMinecraftVersion();
int patchVersion = VersionUtils.getMinecraftPatchVersion();

if (version > 0) {
// Check all supported versions of Minecraft
for (MinecraftVersion supportedVersion : MinecraftVersion.values()) {
if (supportedVersion.isMinecraftVersion(version, patchVersion)) {
minecraftVersion = supportedVersion;
break;
}
throw new RuntimeException();
}
}
if (!SlimefunExtended.checkEnvironment(this)) {
// We want to ensure that the Server uses a compatible server software and have no
// incompatible plugins
Expand Down

0 comments on commit 0ec914b

Please sign in to comment.