Commit 2f60f0c8 authored by Adam Gausmann's avatar Adam Gausmann

Update release to 1.1, add stuff to UserMask, add color support to commands

parent 0475fcbd
Pipeline #5064726 passed with stages
in 23 seconds
......@@ -5,7 +5,7 @@
<parent>
<artifactId>samurai</artifactId>
<groupId>ninja.nonemu</groupId>
<version>1.0.2</version>
<version>1.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......@@ -15,7 +15,7 @@
<dependency>
<groupId>ninja.nonemu</groupId>
<artifactId>ircninja</artifactId>
<version>1.0</version>
<version>1.1</version>
<scope>compile</scope>
</dependency>
<dependency>
......
......@@ -7,6 +7,10 @@ public class UserMask implements Comparable<UserMask> {
this.mask = mask;
}
public UserMask(String nickname, String username, String hostname) {
this(nickname + "!" + username + "@" + hostname);
}
public String getNickname() {
if (mask.contains("!")) {
return mask.substring(0, mask.indexOf("!"));
......
......@@ -6,7 +6,7 @@
<groupId>ninja.nonemu</groupId>
<artifactId>samurai</artifactId>
<version>1.0.2</version>
<version>1.1</version>
<modules>
<module>api</module>
<module>runtime</module>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>samurai</artifactId>
<groupId>ninja.nonemu</groupId>
<version>1.0.2</version>
<version>1.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -12,6 +12,7 @@ import java.util.Queue;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import ninja.nonemu.irc.Color;
import ninja.nonemu.samurai.BotImpl;
import ninja.nonemu.samurai.connection.ChatEvent;
import ninja.nonemu.samurai.connection.User;
......@@ -201,7 +202,8 @@ public class CommandSystemImpl implements CommandSystem {
@EventHandler(priority = Priority.MONITOR, acceptSubclass = false)
public void handleChatEvent(ChatEvent event) {
if (!event.getText().startsWith(commandPrefix)) {
String text = Color.stripColors(event.getText());
if (!text.startsWith(commandPrefix)) {
return;
}
......@@ -209,7 +211,7 @@ public class CommandSystemImpl implements CommandSystem {
return;
}
String[] words = event.getText().split("\\s");
String[] words = text.split("\\s");
String label = words[0].substring(commandPrefix.length());
String[] args = new String[words.length - 1];
System.arraycopy(words, 1, args, 0, args.length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment