mirror of
https://github.com/cnaude/PurpleIRC-spigot.git
synced 2024-11-26 03:55:55 +01:00
* Null pointer fix.
This commit is contained in:
parent
6202673298
commit
cf7197ccd4
@ -1728,6 +1728,9 @@ public final class PurpleBot {
|
||||
if (!this.isConnected()) {
|
||||
return;
|
||||
}
|
||||
if (player == null || message == null) {
|
||||
return;
|
||||
}
|
||||
if (message.isEmpty()) {
|
||||
plugin.logDebug("gameDeath: blank death message for " + player.getDisplayName());
|
||||
return;
|
||||
|
@ -73,6 +73,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.text.Collator;
|
||||
@ -1459,9 +1460,26 @@ public class PurpleIRC extends JavaPlugin {
|
||||
hookList.add(hookFormat(PL_HEROCHAT, false));
|
||||
}
|
||||
if (isPluginEnabled(PL_GRIEFPREVENTION)) {
|
||||
hookList.add(hookFormat(PL_GRIEFPREVENTION, true));
|
||||
griefPreventionHook = new GriefPreventionHook(this);
|
||||
//getServer().getPluginManager().registerEvents(new GriefPreventionListener(this), this);
|
||||
Class cls = null;
|
||||
boolean hooked = false;
|
||||
try {
|
||||
cls = Class.forName("me.ryanhamshire.GriefPrevention.DataStore");
|
||||
} catch (ClassNotFoundException ex) {
|
||||
logDebug(ex.getMessage());
|
||||
}
|
||||
if (cls != null) {
|
||||
for (Method m : cls.getMethods()) {
|
||||
if (m.getName().equals("isSoftMuted")) {
|
||||
hookList.add(hookFormat(PL_GRIEFPREVENTION, true));
|
||||
griefPreventionHook = new GriefPreventionHook(this);
|
||||
hooked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hooked) {
|
||||
hookList.add(hookFormat(PL_GRIEFPREVENTION, false));
|
||||
}
|
||||
} else {
|
||||
hookList.add(hookFormat(PL_GRIEFPREVENTION, false));
|
||||
}
|
||||
|
@ -59,15 +59,23 @@ public class PurpleTabCompleter implements TabCompleter {
|
||||
if (strings.length == 2) {
|
||||
for (PurpleBot ircBot : plugin.ircBots.values()) {
|
||||
for (Channel channel : ircBot.getChannels()) {
|
||||
String channelName = channel.getName();
|
||||
for (User user : channel.getUsers()) {
|
||||
if (user.getNick().startsWith(strings[1])) {
|
||||
if (!list.contains(user.getNick())) {
|
||||
String nick = user.getNick();
|
||||
if (nick.startsWith(strings[1])) {
|
||||
if (list.contains(nick)) {
|
||||
continue;
|
||||
}
|
||||
if (ircBot.tabIgnoreNicks.containsKey(channelName)) {
|
||||
if (ircBot.tabIgnoreNicks.get(channelName).contains(nick)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
list.add(user.getNick());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Player player : plugin.getServer().getOnlinePlayers()) {
|
||||
if (plugin.vanishHook != null) {
|
||||
if (plugin.vanishHook.isVanished(player)) {
|
||||
|
Loading…
Reference in New Issue
Block a user