Compatible with CraftBukkit now.

This commit is contained in:
cnaude 2015-12-14 20:00:46 -07:00
parent 7ec6e42e60
commit 0b1eee3989
7 changed files with 16 additions and 47 deletions

View File

@ -5,7 +5,7 @@
<artifactId>PurpleIRC</artifactId>
<name>PurpleIRC-spigot</name>
<version>1.0-${build.number}</version>
<description>Minecraft IRC integration for Spigot servers.</description>
<description>Minecraft IRC integration for CraftBukkit/Spigot servers.</description>
<url>http://www.spigotmc.org/resources/purpleirc.2836/</url>
<build>
<resources>
@ -82,6 +82,9 @@
<exec>
<arg />
</exec>
<exec>
<arg />
</exec>
</tasks>
</configuration>
</execution>

View File

@ -15,5 +15,6 @@ Any value defined here will override the pom.xml file value but is only applicab
-->
<netbeans.compile.on.save>none</netbeans.compile.on.save>
<netbeans.hint.license>gpl30</netbeans.hint.license>
<org-netbeans-modules-javascript2-requirejs.enabled>true</org-netbeans-modules-javascript2-requirejs.enabled>
</properties>
</project-shared-configuration>

View File

@ -14,7 +14,7 @@
<artifactId>PurpleIRC</artifactId>
<version>1.0-${build.number}</version>
<name>PurpleIRC-spigot</name>
<description>Minecraft IRC integration for Spigot servers.</description>
<description>Minecraft IRC integration for CraftBukkit/Spigot servers.</description>
<url>http://www.spigotmc.org/resources/purpleirc.2836/</url>
<repositories>
@ -440,6 +440,9 @@
<exec dir="../${project.name}/target" executable="scp">
<arg line="PurpleIRC.jar cnaude@h.cnaude.org:spigottest/plugins/PurpleIRC.jar"/>
</exec>
<exec dir="../${project.name}/target" executable="scp">
<arg line="PurpleIRC.jar cnaude@h.cnaude.org:minetest/plugins/PurpleIRC.jar"/>
</exec>
</tasks>
</configuration>
<goals>

View File

@ -19,7 +19,6 @@ package com.cnaude.purpleirc;
import com.cnaude.purpleirc.Events.IRCCommandEvent;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandException;
/**
@ -94,8 +93,9 @@ public class CommandQueueWatcher {
}
/**
*
* @param command
* Add an IRCCommand to the command queue
*
* @param command the IRC command to add to the queue
*/
public void add(IRCCommand command) {
plugin.logDebug("Adding command to queue: " + command.getGameCommand());

View File

@ -28,9 +28,9 @@ public class IRCCommand {
/**
*
* @param sender
* @param consoleSender
* @param command
* @param sender the sender of the command
* @param consoleSender the console sender
* @param command the actual command
*/
public IRCCommand(IRCCommandSender sender, IRCConsoleCommandSender consoleSender, String command) {
this.sender = sender;

View File

@ -57,7 +57,6 @@ import com.cnaude.purpleirc.Hooks.VaultHook;
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;
@ -261,10 +260,6 @@ public class PurpleIRC extends JavaPlugin {
public void onEnable() {
LOG_HEADER = "[" + this.getName() + "]";
LOG_HEADER_F = ChatColor.LIGHT_PURPLE + "[" + this.getName() + "]" + ChatColor.RESET;
if (!CompatChecker.isCompatible(this)) {
this.getPluginLoader().disablePlugin(this);
return;
}
pluginFolder = getDataFolder();
botsFolder = new File(pluginFolder + "/bots");
configFile = new File(pluginFolder, "config.yml");
@ -1695,7 +1690,7 @@ public class PurpleIRC extends JavaPlugin {
*/
public int getOnlinePlayerCount() {
int count = 0;
for (Player player : getServer().getOnlinePlayers()) {
for (Player p : getServer().getOnlinePlayers()) {
count++;
}
return count;

View File

@ -1,33 +0,0 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/
package com.cnaude.purpleirc.Utilities;
import com.cnaude.purpleirc.PurpleIRC;
/**
*
* @author Chris Naude
*/
public class CompatChecker {
public static boolean isCompatible(PurpleIRC plugin) {
if (!plugin.getServer().getVersion().contains("Spigot")) {
plugin.logError("This plugin is only compatible with Spigot. Please download the CraftBukkit version from the BukkitDev site.");
return false;
}
return true;
}
}