Permalink
Browse files

Fixing for CBukkit #600

  • Loading branch information...
1 parent 4689ae8 commit 40357b1ae8c77d5893a8c875e4652e1736777f43 @Animosity committed Mar 30, 2011
View
BIN beta/preview/CraftIRC.jar
Binary file not shown.
View
17 com/ensifera/animosity/craftirc/CraftIRC.java
@@ -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;
@@ -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;
}
@@ -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
@@ -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"));
View
9 com/ensifera/animosity/craftirc/CraftIRCListener.java
@@ -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;
@@ -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
@@ -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 {
@@ -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 {

0 comments on commit 40357b1

Please sign in to comment.