From 1360e32ccaf751e6b124d7ba8f59522706ee3924 Mon Sep 17 00:00:00 2001 From: cnaude Date: Thu, 26 Feb 2015 10:16:15 -0700 Subject: [PATCH] Fix ConsoleCommandSender duplicating messages. --- dependency-reduced-pom.xml | 6 ++ pom.xml | 7 ++ .../cnaude/purpleirc/CommandQueueWatcher.java | 1 + .../purpleirc/IRCConsoleCommandSender.java | 73 ++++++++++++++++++- 4 files changed, 85 insertions(+), 2 deletions(-) diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index dfe1b45..8657162 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -288,6 +288,12 @@ 1.8-SNAPSHOT compile + + com.cnaude.shortify + Shortify-Universal + 1.7-SNAPSHOT + compile + com.cnaude.dynmap DynmapAPI diff --git a/pom.xml b/pom.xml index fd286a8..e146052 100644 --- a/pom.xml +++ b/pom.xml @@ -268,6 +268,13 @@ 1.8-SNAPSHOT + + + com.cnaude.shortify + Shortify-Universal + 1.7-SNAPSHOT + + com.cnaude.dynmap diff --git a/src/main/java/com/cnaude/purpleirc/CommandQueueWatcher.java b/src/main/java/com/cnaude/purpleirc/CommandQueueWatcher.java index b22b576..aa52e86 100644 --- a/src/main/java/com/cnaude/purpleirc/CommandQueueWatcher.java +++ b/src/main/java/com/cnaude/purpleirc/CommandQueueWatcher.java @@ -19,6 +19,7 @@ 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; /** diff --git a/src/main/java/com/cnaude/purpleirc/IRCConsoleCommandSender.java b/src/main/java/com/cnaude/purpleirc/IRCConsoleCommandSender.java index 629e0ea..f3f093f 100644 --- a/src/main/java/com/cnaude/purpleirc/IRCConsoleCommandSender.java +++ b/src/main/java/com/cnaude/purpleirc/IRCConsoleCommandSender.java @@ -19,16 +19,20 @@ package com.cnaude.purpleirc; import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.Server; -import org.bukkit.craftbukkit.v1_8_R1.command.CraftConsoleCommandSender; +import org.bukkit.command.ConsoleCommandSender; +import org.bukkit.conversations.Conversation; +import org.bukkit.conversations.ConversationAbandonedEvent; import org.bukkit.permissions.Permission; +import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; +import org.bukkit.plugin.Plugin; /** * * @author Chris Naude We have to implement our own CommandSender so that we can * receive output from the command dispatcher. */ -public class IRCConsoleCommandSender extends CraftConsoleCommandSender { +public class IRCConsoleCommandSender implements ConsoleCommandSender { private final PurpleBot ircBot; private final String target; @@ -152,4 +156,69 @@ public class IRCConsoleCommandSender extends CraftConsoleCommandSender { plugin.logDebug("sendRawMessage: " + string); } + @Override + public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin, String string, boolean bln, int i) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin, int i) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void removeAttachment(PermissionAttachment pa) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void recalculatePermissions() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public boolean isOp() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void setOp(boolean bln) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public boolean isConversing() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void acceptConversationInput(String string) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public boolean beginConversation(Conversation c) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void abandonConversation(Conversation c) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public void abandonConversation(Conversation c, ConversationAbandonedEvent cae) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + }