diff --git a/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java b/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java index e46f0537..dd7290c1 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java +++ b/eco-api/src/main/java/com/willfp/eco/core/EcoPlugin.java @@ -19,6 +19,7 @@ import com.willfp.eco.core.proxy.ProxyFactory; import com.willfp.eco.core.registry.Registrable; import com.willfp.eco.core.registry.Registry; import com.willfp.eco.core.scheduling.Scheduler; +import com.willfp.eco.core.version.OutdatedEcoVersionError; import com.willfp.eco.core.version.Version; import com.willfp.eco.core.web.UpdateChecker; import org.apache.commons.lang.Validate; @@ -355,7 +356,7 @@ public abstract class EcoPlugin extends JavaPlugin implements PluginLike, Regist this.getLogger().severe("You must be on at least" + this.getMinimumEcoVersion()); this.getLogger().severe("Download the newest version here:"); this.getLogger().severe("https://polymart.org/download/773/recent/JSpprMspkuyecf5y1wQ2Jn8OoLQSQ_IW"); - Bukkit.getPluginManager().disablePlugin(this); + throw new OutdatedEcoVersionError("This plugin requires at least eco version " + this.getMinimumEcoVersion() + " to run."); } } diff --git a/eco-api/src/main/java/com/willfp/eco/core/version/OutdatedEcoVersionError.java b/eco-api/src/main/java/com/willfp/eco/core/version/OutdatedEcoVersionError.java new file mode 100644 index 00000000..5a1ca56f --- /dev/null +++ b/eco-api/src/main/java/com/willfp/eco/core/version/OutdatedEcoVersionError.java @@ -0,0 +1,17 @@ +package com.willfp.eco.core.version; + +import org.jetbrains.annotations.NotNull; + +/** + * An error thrown when eco is outdated. + */ +public class OutdatedEcoVersionError extends Error { + /** + * Create a new OutdatedEcoVersionError. + * + * @param message The message. + */ + public OutdatedEcoVersionError(@NotNull final String message) { + super(message); + } +}