diff --git a/src/main/java/com/cnaude/purpleirc/PurpleIRC.java b/src/main/java/com/cnaude/purpleirc/PurpleIRC.java index 19718fb..049088d 100644 --- a/src/main/java/com/cnaude/purpleirc/PurpleIRC.java +++ b/src/main/java/com/cnaude/purpleirc/PurpleIRC.java @@ -54,6 +54,7 @@ import com.cnaude.purpleirc.Utilities.CaseInsensitiveMap; import com.cnaude.purpleirc.Utilities.ChatTokenizer; import com.cnaude.purpleirc.Utilities.ColorConverter; +import com.cnaude.purpleirc.Utilities.CompatChecker; import com.cnaude.purpleirc.Utilities.NetPackets; import com.cnaude.purpleirc.Utilities.Query; import com.cnaude.purpleirc.Utilities.RegexGlobber; @@ -251,8 +252,7 @@ public PurpleIRC() { public void onEnable() { LOG_HEADER = "[" + this.getName() + "]"; LOG_HEADER_F = ChatColor.LIGHT_PURPLE + "[" + this.getName() + "]" + ChatColor.RESET; - if (getServer().getVersion().contains("Spigot") && getServer().getVersion().contains("MC: 1.8")) { - logError("This plugin is not compatible with Spigot 1.8. Please download the Spigot version from the Spigot site."); + if (!CompatChecker.isCompatible(this)) { this.getPluginLoader().disablePlugin(this); return; } diff --git a/src/main/java/com/cnaude/purpleirc/Utilities/CompatChecker.java b/src/main/java/com/cnaude/purpleirc/Utilities/CompatChecker.java new file mode 100644 index 0000000..9828bda --- /dev/null +++ b/src/main/java/com/cnaude/purpleirc/Utilities/CompatChecker.java @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2015 cnaude + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.cnaude.purpleirc.Utilities; + +import com.cnaude.purpleirc.PurpleIRC; + +/** + * + * @author cnaude + */ +public class CompatChecker { + public static boolean isCompatible(PurpleIRC plugin) { + if (plugin.getServer().getVersion().contains("Spigot") && plugin.getServer().getVersion().contains("MC: 1.8")) { + plugin.logError("This plugin is not compatible with Spigot 1.8. Please download the Spigot version from the Spigot site."); + return false; + } + return true; + } +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 8fe03ed..cb15953 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,8 +1,8 @@ -name: ${project.name} +name: ${project.artifactId} version: ${project.version} description: ${project.description} author: cnaude -website: http://dev.bukkit.org/server-mods/purpleirc/ +website: ${project.url} main: com.cnaude.purpleirc.PurpleIRC softdepend: - Vault