QOL: Warn users when plugin is running on an unsupported version
This commit is contained in:
@@ -498,15 +498,9 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
|
|||||||
PluginManager pm = this.getServer().getPluginManager();
|
PluginManager pm = this.getServer().getPluginManager();
|
||||||
|
|
||||||
this.accessor = new InternalAccessor(this);
|
this.accessor = new InternalAccessor(this);
|
||||||
// Version check
|
|
||||||
if (!this.accessor.isSupported()) {
|
|
||||||
this.getLogger().info("Your version of CraftBukkit (" + this.accessor.getVersion() + ") is not supported.");
|
|
||||||
this.getLogger().info("If this version is a recent release, check for an update.");
|
|
||||||
this.getLogger().info("If this is an older version, ensure that you've downloaded the legacy support version.");
|
|
||||||
pm.disablePlugin(this);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Version check
|
||||||
|
if (this.accessor.isSupported()) {
|
||||||
// Update existing configuration. May require internal access.
|
// Update existing configuration. May require internal access.
|
||||||
new ConfigUpdater(this).checkForUpdates();
|
new ConfigUpdater(this).checkForUpdates();
|
||||||
|
|
||||||
@@ -528,9 +522,25 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
|
|||||||
this.getCommand("searchenchant").setExecutor(new SearchEnchantPluginCommand(this));
|
this.getCommand("searchenchant").setExecutor(new SearchEnchantPluginCommand(this));
|
||||||
this.getCommand("silentchest").setExecutor(new SilentChestPluginCommand(this));
|
this.getCommand("silentchest").setExecutor(new SilentChestPluginCommand(this));
|
||||||
this.getCommand("anychest").setExecutor(new AnyChestPluginCommand(this));
|
this.getCommand("anychest").setExecutor(new AnyChestPluginCommand(this));
|
||||||
|
} else {
|
||||||
|
this.getLogger().info("Your version of CraftBukkit (" + this.accessor.getVersion() + ") is not supported.");
|
||||||
|
this.getLogger().info("If this version is a recent release, check for an update.");
|
||||||
|
this.getLogger().info("If this is an older version, ensure that you've downloaded the legacy support version.");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
if (!this.accessor.isSupported()) {
|
||||||
|
sender.sendMessage("Your version of CraftBukkit (" + this.accessor.getVersion() + ") is not supported.");
|
||||||
|
sender.sendMessage("If this version is a recent release, check for an update.");
|
||||||
|
sender.sendMessage("If this is an older version, ensure that you've downloaded the legacy support version.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public void releaseAllPlayers(final Plugin plugin) {
|
public void releaseAllPlayers(final Plugin plugin) {
|
||||||
Iterator<Map.Entry<String, Class<? extends Plugin>>> iterator = this.pluginUsage.entries().iterator();
|
Iterator<Map.Entry<String, Class<? extends Plugin>>> iterator = this.pluginUsage.entries().iterator();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user