Skip to content

Commit

Permalink
Fixing for CBukkit #600
Browse files Browse the repository at this point in the history
  • Loading branch information
Animosity committed Mar 30, 2011
1 parent 4689ae8 commit 40357b1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
Binary file modified beta/preview/CraftIRC.jar
Binary file not shown.
17 changes: 9 additions & 8 deletions com/ensifera/animosity/craftirc/CraftIRC.java
Expand Up @@ -29,6 +29,7 @@
import org.bukkit.event.Event.Priority;
import org.bukkit.event.Event;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
// import org.bukkit.plugin.PluginLoader;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.config.Configuration;
Expand Down Expand Up @@ -343,7 +344,7 @@ private boolean cmdRawIrcCommand(CommandSender sender, String[] args) {
if (this.isDebug()) CraftIRC.log.info(String.format(CraftIRC.NAME + " cmdRawIrcCommand(sender=" + sender.toString() + ", args=" + Util.combineSplit(0, args, " ")));
if (args.length < 2)
return false;
this.sendRawToBot(Integer.parseInt(args[0]), Util.combineSplit(1, args, " "));
this.sendRawToBot(Util.combineSplit(1, args, " "), Integer.parseInt(args[0]));
return true;
}

Expand Down Expand Up @@ -406,13 +407,13 @@ protected void sendMessage(RelayedMessage msg, String tag, String event) {

protected void sendRawToBot(String rawMessage, int bot) {
if (this.isDebug()) CraftIRC.log.info(String.format(CraftIRC.NAME + " sendRawToBot(bot=" + bot + ", message=" + rawMessage));
Minebot target = instances.get(bot);
target.sendRawLineViaQueue(rawMessage);
Minebot targetBot = instances.get(bot);
targetBot.sendRawLineViaQueue(rawMessage);
}

protected void sendMsgToTargetViaBot(String message, String target, int bot) {
Minebot target = instances.get(bot);
target.sendMessage(target, message);
Minebot targetBot = instances.get(bot);
targetBot.sendMessage(target, message);
}

/** TODO: MAKE THIS
Expand Down Expand Up @@ -786,13 +787,13 @@ protected String getPermPrefix(String world, String pl) {
return colorizeName(result.replaceAll("&([0-9a-f])", "§$1"));
}

protected String getPermSuffix(String pl) {
protected String getPermSuffix(String world, String pl) {
if (perms == null)
return "";
String group = perms.getGroup(pl);
String group = perms.getGroup(world, pl);
if (group == null)
return "";
String result = perms.getGroupSuffix(group);
String result = perms.getGroupSuffix(world, group);
if (result == null)
return "";
return colorizeName(result.replaceAll("&([0-9a-f])", "§$1"));
Expand Down
9 changes: 6 additions & 3 deletions com/ensifera/animosity/craftirc/CraftIRCListener.java
Expand Up @@ -6,8 +6,11 @@
import org.bukkit.entity.Player;
import org.bukkit.ChatColor;
import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerListener;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
Expand All @@ -21,7 +24,7 @@ public CraftIRCListener(CraftIRC plugin) {
this.plugin = plugin;
}

public void onPlayerCommandPreprocess(PlayerChatEvent event) {
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
try {
String[] split = event.getMessage().split(" ");
// ACTION/EMOTE can't be claimed, so use onPlayerCommandPreprocess
Expand Down Expand Up @@ -62,7 +65,7 @@ public void onPlayerChat(PlayerChatEvent event) {
}
}

public void onPlayerJoin(PlayerEvent event) {
public void onPlayerJoin(PlayerJoinEvent event) {
if (this.plugin.isHeld(CraftIRC.HoldType.JOINS))
return;
try {
Expand All @@ -76,7 +79,7 @@ public void onPlayerJoin(PlayerEvent event) {
}
}

public void onPlayerQuit(PlayerEvent event) {
public void onPlayerQuit(PlayerQuitEvent event) {
if (this.plugin.isHeld(CraftIRC.HoldType.QUITS))
return;
try {
Expand Down

0 comments on commit 40357b1

Please sign in to comment.