mirror of
https://github.com/cnaude/PurpleIRC-spigot.git
synced 2024-11-29 05:26:19 +01:00
Possible duplicate non blocking space fix.
This commit is contained in:
parent
15a2a3cea0
commit
015870f3c7
4
pom.xml
4
pom.xml
@ -49,11 +49,11 @@
|
||||
</snapshots>
|
||||
</repository>
|
||||
|
||||
<!-- Vault -->
|
||||
<!-- Vault
|
||||
<repository>
|
||||
<id>vault-repo</id>
|
||||
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
|
||||
</repository>
|
||||
</repository> -->
|
||||
|
||||
<!--
|
||||
<repository>
|
||||
|
@ -98,6 +98,8 @@ import java.util.TreeMap;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -318,10 +320,18 @@ public class PurpleIRC extends JavaPlugin {
|
||||
}
|
||||
}
|
||||
getServer().getPluginManager().registerEvents(new IRCMessageListener(this), this);
|
||||
if (getServer().getVersion().contains("MC: 1.12") || getServer().getVersion().contains("MC: 1.13")) {
|
||||
getServer().getPluginManager().registerEvents(new GamePlayerPlayerAdvancementDoneListener(this), this);
|
||||
} else {
|
||||
getServer().getPluginManager().registerEvents(new GamePlayerPlayerAchievementAwardedListener(this), this);
|
||||
Pattern p = Pattern.compile("^MC: [0-9]\\.([0-9]+).*");
|
||||
Matcher m = p.matcher(getServer().getVersion());
|
||||
if (m.find()) {
|
||||
int x = Integer.parseInt(m.group(1));
|
||||
if (x >= 12) {
|
||||
logInfo("Registering GamePlayerPlayerAdvancementDoneListener because version >= 1.12");
|
||||
getServer().getPluginManager().registerEvents(new GamePlayerPlayerAdvancementDoneListener(this), this);
|
||||
} else {
|
||||
logInfo("Registering GamePlayerPlayerAchievementAwardedListener because version < 1.12");
|
||||
getServer().getPluginManager().registerEvents(new GamePlayerPlayerAchievementAwardedListener(this), this);
|
||||
}
|
||||
logInfo("Pattern mismatch!: " + getServer().getVersion());
|
||||
}
|
||||
getServer().getPluginManager().registerEvents(new GamePlayerGameModeChangeListener(this), this);
|
||||
getServer().getPluginManager().registerEvents(new GamePlayerChatListener(this), this);
|
||||
|
@ -1228,6 +1228,9 @@ public class ChatTokenizer {
|
||||
}
|
||||
|
||||
public String addZeroWidthSpace(String s) {
|
||||
if (s.contains("\u200B")) {
|
||||
return s;
|
||||
}
|
||||
if (s.length() > 1) {
|
||||
String a = s.substring(0, 1);
|
||||
String b = s.substring(1);
|
||||
|
Loading…
Reference in New Issue
Block a user