Fix ConsoleCommandSender duplicating messages.

This commit is contained in:
cnaude 2015-02-26 10:16:15 -07:00
parent f842fe924a
commit 1360e32cca
4 changed files with 85 additions and 2 deletions

View File

@ -288,6 +288,12 @@
<version>1.8-SNAPSHOT</version> <version>1.8-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.cnaude.shortify</groupId>
<artifactId>Shortify-Universal</artifactId>
<version>1.7-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>com.cnaude.dynmap</groupId> <groupId>com.cnaude.dynmap</groupId>
<artifactId>DynmapAPI</artifactId> <artifactId>DynmapAPI</artifactId>

View File

@ -268,6 +268,13 @@
<version>1.8-SNAPSHOT</version> <version>1.8-SNAPSHOT</version>
</dependency> </dependency>
<!-- Shortify -->
<dependency>
<groupId>com.cnaude.shortify</groupId>
<artifactId>Shortify-Universal</artifactId>
<version>1.7-SNAPSHOT</version>
</dependency>
<!-- DynmapAPI --> <!-- DynmapAPI -->
<dependency> <dependency>
<groupId>com.cnaude.dynmap</groupId> <groupId>com.cnaude.dynmap</groupId>

View File

@ -19,6 +19,7 @@ package com.cnaude.purpleirc;
import com.cnaude.purpleirc.Events.IRCCommandEvent; import com.cnaude.purpleirc.Events.IRCCommandEvent;
import java.util.Queue; import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ConcurrentLinkedQueue;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandException; import org.bukkit.command.CommandException;
/** /**

View File

@ -19,16 +19,20 @@ package com.cnaude.purpleirc;
import java.util.Set; import java.util.Set;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Server; 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.Permission;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
/** /**
* *
* @author Chris Naude We have to implement our own CommandSender so that we can * @author Chris Naude We have to implement our own CommandSender so that we can
* receive output from the command dispatcher. * receive output from the command dispatcher.
*/ */
public class IRCConsoleCommandSender extends CraftConsoleCommandSender { public class IRCConsoleCommandSender implements ConsoleCommandSender {
private final PurpleBot ircBot; private final PurpleBot ircBot;
private final String target; private final String target;
@ -152,4 +156,69 @@ public class IRCConsoleCommandSender extends CraftConsoleCommandSender {
plugin.logDebug("sendRawMessage: " + string); 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.
}
} }