Permalink
Browse files

Added %world% RelayedMessage formatter tag, rebuild CraftIRC: 2.0 Pre…

…view 4
  • Loading branch information...
1 parent d84bb47 commit f7d3efd2f8f777d23559a39f3a6d123d8ae3f5fa @Animosity committed Mar 1, 2011
View
40 .project
@@ -1,17 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>CraftIRC</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>CraftIRC</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
9 .settings/org.eclipse.jdt.core.prefs
@@ -1,12 +1,13 @@
-#Thu Feb 03 18:18:33 GMT 2011
+#Mon Feb 28 19:28:54 MST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5
View
BIN beta/preview/CraftIRC.jar
Binary file not shown.
View
1 com/ensifera/animosity/craftirc/CraftIRCListener.java
@@ -45,6 +45,7 @@ public void onPlayerChat(PlayerChatEvent event) {
msg.formatting = "chat";
msg.sender = event.getPlayer().getName();
msg.message = event.getMessage();
+ msg.world = event.getPlayer().getWorld().getName();
this.plugin.sendMessage(msg, null, "all-chat");
} catch (Exception e) {
View
17 com/ensifera/animosity/craftirc/RelayedMessage.java
@@ -16,15 +16,16 @@
private CraftIRC plugin;
private EndPoint source; //Origin endpoint of the message
private EndPoint target; //Target endpoint of the message
- public String formatting; //Formatting string ID; Mandatory before toString
- public String sender; //Sender of the message/Main subject
- public String message; //Message, reason, target nickname
+ public String formatting; //Formatting string ID; Mandatory before toString
+ public String sender; //Sender of the message/Main subject
+ public String message; //Message, reason, target nickname
public String moderator; //Person who kicked or banned, if applicable
- public String srcChannel; //Source channel; Mandatory before toString if the origin is IRC
- public int srcBot; //Source bot ID; Mandatory before toString if the origin is IRC
- public String trgChannel; //Target channel; Mandatory before toString if the target is IRC
- public int trgBot; //Target bot ID; Mandatory before toString if the origin is IRC
+ public String srcChannel; //Source channel; Mandatory before toString if the origin is IRC
+ public int srcBot; //Source bot ID; Mandatory before toString if the origin is IRC
+ public String trgChannel; //Target channel; Mandatory before toString if the target is IRC
+ public int trgBot; //Target bot ID; Mandatory before toString if the origin is IRC
public String srcChannelTag; //Source tag; Contains the tag of the source channel
+ public String world; //Source tag; The name of the world the Player sender is chatting from
protected RelayedMessage(CraftIRC plugin, EndPoint source, EndPoint target) {
this.plugin = plugin;
@@ -39,6 +40,7 @@ protected RelayedMessage(CraftIRC plugin, EndPoint source, EndPoint target) {
srcBot = -1;
trgBot = -1;
srcChannelTag = plugin.chanTagMap.get(new DualKey(srcBot, srcChannel));
+ world = "";
//System.out.println("RelayedMessage: "+srcBot+ " " + srcChannel + " srcChannelTag = " + srcChannelTag);
//if (srcChannelTag == null) srcChannelTag = String.valueOf(this.srcBot) + "_" + srcChannel;
@@ -117,6 +119,7 @@ public String asString(EndPoint realTarget) throws RelayedMessageException {
result = result.replaceAll("%moderator%", moderator);
result = result.replaceAll("%srcChannel%", srcChannel);
result = result.replaceAll("%trgChannel%", trgChannel);
+ result = result.replaceAll("%world%", world);
if (source == EndPoint.GAME && this.plugin.hasPerms() && this.plugin.cChanNameColors(trgBot, trgChannel)) {
result = result.replaceAll("%prefix%", this.plugin.getPermPrefix(sender));
result = result.replaceAll("%suffix%", this.plugin.getPermSuffix(sender));
View
2 com/ensifera/animosity/craftirc/example/CraftIRCPluginExample.java
@@ -13,7 +13,7 @@
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.PluginLoader;
import org.bukkit.plugin.java.JavaPlugin;
-import com.ensifera.animosity.craftirc.*;
+import com.ensifera.animosity.craftirc.CraftIRC;
/**
* @author Animosity
View
1 com/ensifera/animosity/craftirc/example/CraftIRCPluginExampleListener.java
@@ -30,7 +30,6 @@ public void onCustomEvent(Event event) {
if (!ircEvent.isHandled()) {
switch (ircEvent.eventMode) {
case COMMAND:
-
if (ircEvent.msgData.message.startsWith("example")) {
this.plugin.sendMessageToTag("This is an example custom CraftIRC command.",
ircEvent.msgData.srcChannelTag);
View
2 plugin.yml
@@ -1,6 +1,6 @@
name: CraftIRC
main: com.ensifera.animosity.craftirc.CraftIRC
-version: 2.0 Preview 3a
+version: 2.0 Preview 4
commands:
irc:
description: Sends a message to all IRC channels

0 comments on commit f7d3efd

Please sign in to comment.