mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-01-22 07:21:52 +01:00
Auto disable on unsupported versions
This commit is contained in:
parent
ad3852d3f4
commit
10368f909b
@ -3,6 +3,7 @@ package com.songoda.skyblock;
|
|||||||
import com.songoda.core.SongodaCore;
|
import com.songoda.core.SongodaCore;
|
||||||
import com.songoda.core.SongodaPlugin;
|
import com.songoda.core.SongodaPlugin;
|
||||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||||
|
import com.songoda.core.compatibility.ServerVersion;
|
||||||
import com.songoda.core.configuration.Config;
|
import com.songoda.core.configuration.Config;
|
||||||
import com.songoda.core.gui.GuiManager;
|
import com.songoda.core.gui.GuiManager;
|
||||||
import com.songoda.core.hooks.EconomyManager;
|
import com.songoda.core.hooks.EconomyManager;
|
||||||
@ -110,14 +111,19 @@ public class SkyBlock extends SongodaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPluginEnable() {
|
public void onPluginEnable() {
|
||||||
|
if(ServerVersion.isServerVersionAbove(ServerVersion.V1_16)) {
|
||||||
|
this.getLogger().warning("This Minecraft version is not supported. Disabling...");
|
||||||
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
paper = false;
|
|
||||||
try {
|
try {
|
||||||
Class.forName("com.destroystokyo.paper.PaperConfig");
|
Class.forName("com.destroystokyo.paper.PaperConfig");
|
||||||
paper = true;
|
paper = true;
|
||||||
paperAsync = Bukkit.spigot().getPaperConfig().getBoolean("settings.async-chunks.enable", false);
|
paperAsync = Bukkit.spigot().getPaperConfig().getBoolean("settings.async-chunks.enable", false);
|
||||||
this.getLogger().info("Enabling Paper hooks");
|
this.getLogger().info("Enabling Paper hooks");
|
||||||
} catch (ClassNotFoundException ignored) {
|
} catch (ClassNotFoundException ignored) {
|
||||||
|
paper = false;
|
||||||
PaperLib.suggestPaper(this);
|
PaperLib.suggestPaper(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user