Testing autoupdate improvements

This commit is contained in:
Norbi Peti 2016-12-31 18:30:39 +01:00
parent 7aeff53967
commit 7d813e8d59
2 changed files with 8 additions and 1 deletions

View file

@ -60,6 +60,7 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
public static final HashMap<String, DiscordSender> UnconnectedSenders = new HashMap<>(); public static final HashMap<String, DiscordSender> UnconnectedSenders = new HashMap<>();
public static final HashMap<String, DiscordPlayerSender> ConnectedSenders = new HashMap<>(); public static final HashMap<String, DiscordPlayerSender> ConnectedSenders = new HashMap<>();
public static short ListC = 0;
public static void resetLastMessage() { public static void resetLastMessage() {
lastmessage = null; lastmessage = null;
@ -114,6 +115,11 @@ public class MCChatListener implements Listener, IListener<MessageReceivedEvent>
+ DiscordPlugin.botchannel.mention()); + DiscordPlugin.botchannel.mention());
return; return;
} }
if (cmd.equals("list") && Bukkit.getOnlinePlayers().size() == 0 && ListC++ > 2) // Lowered already
{
dsender.sendMessage("Stop it. You know the answer.");
ListC = 0;
} else
Bukkit.dispatchCommand(dsender, cmd); Bukkit.dispatchCommand(dsender, cmd);
} else } else
TBMCChatAPI.SendChatMessage(Channel.GlobalChat, dsender, TBMCChatAPI.SendChatMessage(Channel.GlobalChat, dsender,

View file

@ -29,6 +29,7 @@ public class MCListener implements Listener {
} }
DiscordPlugin.sendMessageToChannel(DiscordPlugin.chatchannel, DiscordPlugin.sendMessageToChannel(DiscordPlugin.chatchannel,
e.GetPlayer().getPlayerName() + " joined the game"); e.GetPlayer().getPlayerName() + " joined the game");
MCChatListener.ListC = 0;
} }
@EventHandler @EventHandler