コミットを比較

...
4 コミット
作成者 SHA1 メッセージ 日付
ucchy 0866722243 LunaChat v3.0.12 : Fixed issue #203 2020-08-29 23:12:58 +09:00
ucchy a58830f314 LunaChat v3.0.12 : Updated pom.xml 2020-08-29 22:44:59 +09:00
ucchy 6cdd8438f7 LunaChat v3.0.11 : Fixed issue #202 2020-08-23 00:35:24 +09:00
ucchy 854abef1b3 LunaChat v3.0.11 : Fixed issue #201 2020-08-16 10:37:19 +09:00
8個のファイルの変更、75行の追加、30行の削除

検索条件に一致するファイルはありません

+26 -21
ファイルの表示
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.ucchyocean</groupId>
<artifactId>LunaChat</artifactId>
<version>3.0.10</version>
<version>3.0.12</version>
<description>A powerfull chat channel plugin with IME (Kana-Kanji conversion) support</description>
<url>https://github.com/ucchyocean/LunaChat</url>
@@ -101,18 +101,23 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<junitArtifactName>junit:junit</junitArtifactName>
<encoding>UTF-8</encoding>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<junitArtifactName>junit:junit</junitArtifactName>
<encoding>UTF-8</encoding>
<inputEncoding>UTF-8</inputEncoding>
<outputEncoding>UTF-8</outputEncoding>
<argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>1.3.1</version>
</plugin>
</plugins>
</build>
@@ -158,7 +163,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<version>1.16.2-R0.1-SNAPSHOT</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>
@@ -172,7 +177,7 @@
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-chat</artifactId>
<version>1.16-R0.1</version>
<version>1.16-R0.3</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>
@@ -212,7 +217,7 @@
<dependency>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.128</version>
<version>2.1.145</version>
<optional>true</optional>
<scope>provided</scope>
<exclusions>
@@ -241,7 +246,7 @@
<dependency>
<groupId>net.alpenblock</groupId>
<artifactId>BungeePerms</artifactId>
<version>4.0-dev-106</version>
<version>4.0-dev-112</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>
@@ -267,22 +272,22 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>16.0.2</version>
<version>20.0.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13</version>
<scope>test</scope>
</dependency>
</dependencies>
+1 -2
ファイルの表示
@@ -9,7 +9,6 @@ import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
@@ -188,7 +187,7 @@ public class BukkitChannel extends Channel {
// 設定に応じて、コンソールに出力する
if ( config.isDisplayChatOnConsole() ) {
Bukkit.getLogger().info(ChatColor.stripColor(message));
Bukkit.getLogger().info(message);
}
// 受信者が自分以外いない場合は、メッセージを表示する
+1 -1
ファイルの表示
@@ -83,7 +83,7 @@ public class ListCommand extends LunaChatSubCommand {
ChannelMember sender, String label, String[] args) {
int page = 1;
if ( args.length >= 2 && args[1].matches("[0-9]") ) {
if ( args.length >= 2 && args[1].matches("[0-9]+") ) {
page = Integer.parseInt(args[1]);
}
+7
ファイルの表示
@@ -213,6 +213,13 @@ public class ClickableFormat {
} else { // type.equals("SUGGEST_COMMAND")
tc.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command));
}
// componentsの最後の要素のカラーコードを、TextComponentにも反映させる。 see issue #202
if ( components.size() > 0 ) {
BaseComponent last = components.get(components.size() - 1);
tc.setColor(last.getColor());
}
components.add(tc);
lastIndex = matcher.end();
+4 -3
ファイルの表示
@@ -29,9 +29,10 @@ public class KeywordReplacer {
* @param value 値
*/
public void replace(String keyword, String value) {
int start;
while ( (start = str.indexOf(keyword)) > -1 ) {
str.replace(start, start + keyword.length(), value);
int index = 0;
while ( (index = str.indexOf(keyword, index)) > -1 ) {
str.replace(index, index + keyword.length(), value);
index += value.length();
}
}
+1 -1
ファイルの表示
@@ -37,7 +37,7 @@ public class ChannelMemberDummy extends ChannelMember {
*/
@Override
public String getDisplayName() {
return "うっちぃ";
return "&aうっちぃ";
}
/**
+6 -1
ファイルの表示
@@ -39,11 +39,16 @@ public class ClickableFormatTest extends TestCase {
Messages.initialize(new File(MESSAGES_FOLDER), null, "ja");
String format = "&f[%color%ch&f]%prefix%displayname%suffix&a:&f %msg";
//String format = "&f[%color%ch&f]%prefix%displayname%suffix&a:&f %msg";
String format = "&7[%color%ch&7]%prefix%username: &f%msg";
String jpFormat = "%japanize&7 $%msg";
ChannelMember member = new ChannelMemberDummy();
Channel channel = new StandaloneChannel("r");
channel.setColorCode(ChatColor.AQUA.toString());
ClickableFormat f = ClickableFormat.makeFormat(format, member, channel, true);
f.replace("%msg", jpFormat);
System.out.println("pre = " + f.toString() + ", legacy text = " + f.toLegacyText());
+29 -1
ファイルの表示
@@ -15,7 +15,7 @@ public class KeywordReplacerTest extends TestCase {
private static final int MAX = 10;
public void test() {
public void testSpeedOfReplacement() {
String testee = "";
for ( int i=1; i<=MAX; i++ ) {
@@ -42,4 +42,32 @@ public class KeywordReplacerTest extends TestCase {
assertTrue(test1.equals(test2.toString()));
}
public void testSafetyOfRecursiveReplacement() {
String testee = "%prefix%username&f: %msg";
String keyword = "%msg";
String val1 = "&f%japanize&7 #%msg";
//String val2 = "発言の内容";
String val2 = "%msg発%msg言%msgの%msg内%msg容%msg";
KeywordReplacer test1 = new KeywordReplacer(testee);
long start = System.currentTimeMillis();
test1.replace(keyword, val1);
test1.replace(keyword, val2);
long time = System.currentTimeMillis() - start;
System.out.println("test1 time = " + time + ", str = " + test1.toString());
String test2 = new String(testee);
start = System.currentTimeMillis();
test2 = test2.replace(keyword, val1);
test2 = test2.replace(keyword, val2);
time = System.currentTimeMillis() - start;
System.out.println("test2 time = " + time + ", str = " + test2);
assertTrue(test1.toString().equals(test2));
}
}