FIXED #39! Mostly.
This commit is contained in:
parent
9d18604c25
commit
5cdbe61166
6 changed files with 149 additions and 101 deletions
|
@ -15,41 +15,20 @@ public final class ChatFormatter {
|
||||||
private Predicate<String> onmatch;
|
private Predicate<String> onmatch;
|
||||||
private String openlink;
|
private String openlink;
|
||||||
private Priority priority;
|
private Priority priority;
|
||||||
|
private String replacewith;
|
||||||
|
|
||||||
private static final String[] RainbowPresserColors = new String[] { "red", "gold", "yellow", "green", "blue",
|
private static final String[] RainbowPresserColors = new String[] { "red", "gold", "yellow", "green", "blue",
|
||||||
"dark_purple" };
|
"dark_purple" }; // TODO
|
||||||
|
|
||||||
public ChatFormatter(Pattern regex, Format format) {
|
public ChatFormatter(Pattern regex, Format format, Color color, Predicate<String> onmatch, String openlink,
|
||||||
|
Priority priority, String replacewith) {
|
||||||
this.regex = regex;
|
this.regex = regex;
|
||||||
this.format = format;
|
this.format = format;
|
||||||
this.priority = Priority.High;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChatFormatter(Pattern regex, Format format, String openlink) {
|
|
||||||
this.regex = regex;
|
|
||||||
this.format = format;
|
|
||||||
this.openlink = openlink;
|
|
||||||
this.priority = Priority.High;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChatFormatter(Pattern regex, Color color, String openlink, Priority priority) {
|
|
||||||
this.regex = regex;
|
|
||||||
this.color = color;
|
|
||||||
this.openlink = openlink;
|
|
||||||
this.priority = priority;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChatFormatter(Pattern regex, Color color, Priority priority) {
|
|
||||||
this.regex = regex;
|
|
||||||
this.color = color;
|
|
||||||
this.priority = priority;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChatFormatter(Pattern regex, Color color, Predicate<String> onmatch, Priority priority) {
|
|
||||||
this.regex = regex;
|
|
||||||
this.color = color;
|
this.color = color;
|
||||||
this.onmatch = onmatch;
|
this.onmatch = onmatch;
|
||||||
this.priority = priority;
|
this.openlink = openlink;
|
||||||
|
this.priority = Priority.High;
|
||||||
|
this.replacewith = replacewith;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String Combine(List<ChatFormatter> formatters, String str) {
|
public static String Combine(List<ChatFormatter> formatters, String str) {
|
||||||
|
@ -67,8 +46,7 @@ public final class ChatFormatter {
|
||||||
groups.add(matcher.group(i + 1));
|
groups.add(matcher.group(i + 1));
|
||||||
if (groups.size() > 0)
|
if (groups.size() > 0)
|
||||||
DebugCommand.SendDebugMessage("First group: " + groups.get(0));
|
DebugCommand.SendDebugMessage("First group: " + groups.get(0));
|
||||||
FormattedSection section = new FormattedSection(formatter, matcher.start(), matcher.end() - 1,
|
FormattedSection section = new FormattedSection(formatter, matcher.start(), matcher.end() - 1, groups);
|
||||||
groups);
|
|
||||||
sections.add(section);
|
sections.add(section);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,8 +74,8 @@ public final class ChatFormatter {
|
||||||
origend = origend2;
|
origend = origend2;
|
||||||
origend2 = tmp;
|
origend2 = tmp;
|
||||||
}
|
}
|
||||||
FormattedSection section = new FormattedSection(
|
FormattedSection section = new FormattedSection(sections.get(i - 1).Formatters, sections.get(i).Start,
|
||||||
sections.get(i - 1).Formatters, sections.get(i).Start, origend, sections.get(i - 1).Matches);
|
origend, sections.get(i - 1).Matches);
|
||||||
section.Formatters.addAll(sections.get(i).Formatters);
|
section.Formatters.addAll(sections.get(i).Formatters);
|
||||||
section.Matches.addAll(sections.get(i).Matches);
|
section.Matches.addAll(sections.get(i).Matches);
|
||||||
sections.add(i, section);
|
sections.add(i, section);
|
||||||
|
@ -124,10 +102,12 @@ public final class ChatFormatter {
|
||||||
sections.remove(i);
|
sections.remove(i);
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
if (i < sections.size() && sections.get(i).End < sections.get(i).Start) {
|
for (int j = i - 1; j <= i + 1; j++) {
|
||||||
DebugCommand.SendDebugMessage("Removing section: " + sections.get(i));
|
if (j < sections.size() && sections.get(j).End < sections.get(j).Start) {
|
||||||
sections.remove(i);
|
DebugCommand.SendDebugMessage("Removing section: " + sections.get(j));
|
||||||
found = true;
|
sections.remove(j);
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
i = nextindex - 1;
|
i = nextindex - 1;
|
||||||
i++;
|
i++;
|
||||||
|
@ -151,27 +131,31 @@ public final class ChatFormatter {
|
||||||
DebugCommand.SendDebugMessage("Applying section: " + section);
|
DebugCommand.SendDebugMessage("Applying section: " + section);
|
||||||
String originaltext = str.substring(section.Start, section.End + 1);
|
String originaltext = str.substring(section.Start, section.End + 1);
|
||||||
DebugCommand.SendDebugMessage("Originaltext: " + originaltext);
|
DebugCommand.SendDebugMessage("Originaltext: " + originaltext);
|
||||||
finalstring.append(",{\"text\":\""); // TODO: Bool replace - Replace with match $1?
|
|
||||||
finalstring.append(originaltext);
|
|
||||||
finalstring.append("\"");
|
|
||||||
Color color = null;
|
Color color = null;
|
||||||
Format format = null;
|
Format format = null;
|
||||||
String openlink = null;
|
String openlink = null;
|
||||||
Priority priority = null;
|
String replacewith = null;
|
||||||
|
section.Formatters.sort((cf1, cf2) -> cf1.priority.compareTo(cf2.priority));
|
||||||
for (ChatFormatter formatter : section.Formatters) {
|
for (ChatFormatter formatter : section.Formatters) {
|
||||||
DebugCommand.SendDebugMessage("Applying formatter: " + formatter);
|
DebugCommand.SendDebugMessage("Applying formatter: " + formatter);
|
||||||
if (formatter.onmatch == null || formatter.onmatch.test(originaltext)) {
|
if (formatter.onmatch == null || formatter.onmatch.test(originaltext)) {
|
||||||
if (priority == null || priority.GetValue() < formatter.priority.GetValue()) {
|
if (formatter.color != null)
|
||||||
color = formatter.color;
|
color = formatter.color;
|
||||||
format = formatter.format; // TODO: Don't overwrite
|
if (formatter.format != null)
|
||||||
// parts, and work until all
|
format = formatter.format;
|
||||||
// of them are combined
|
if (formatter.openlink != null)
|
||||||
openlink = formatter.openlink;
|
openlink = formatter.openlink;
|
||||||
priority = formatter.priority;
|
if (formatter.replacewith != null)
|
||||||
}
|
replacewith = formatter.replacewith;
|
||||||
} else
|
} else
|
||||||
DebugCommand.SendDebugMessage("Onmatch predicate returned false.");
|
DebugCommand.SendDebugMessage("Onmatch predicate returned false.");
|
||||||
}
|
}
|
||||||
|
finalstring.append(",{\"text\":\"");
|
||||||
|
if (replacewith != null)
|
||||||
|
finalstring.append(replacewith.replace("$1", section.Matches.get(0)));
|
||||||
|
else
|
||||||
|
finalstring.append(originaltext);
|
||||||
|
finalstring.append("\"");
|
||||||
if (color != null) {
|
if (color != null) {
|
||||||
finalstring.append(",\"color\":\"");
|
finalstring.append(",\"color\":\"");
|
||||||
finalstring.append(color.name);
|
finalstring.append(color.name);
|
||||||
|
@ -190,7 +174,8 @@ public final class ChatFormatter {
|
||||||
finalstring.append("}");
|
finalstring.append("}");
|
||||||
}
|
}
|
||||||
DebugCommand.SendDebugMessage("Finalstring: " + finalstring);
|
DebugCommand.SendDebugMessage("Finalstring: " + finalstring);
|
||||||
return finalstring.toString(); // TODO
|
return finalstring.toString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
85
src/buttondevteam/thebuttonmcchat/ChatFormatterBuilder.java
Normal file
85
src/buttondevteam/thebuttonmcchat/ChatFormatterBuilder.java
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
package buttondevteam.thebuttonmcchat;
|
||||||
|
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import buttondevteam.thebuttonmcchat.ChatFormatter.Color;
|
||||||
|
import buttondevteam.thebuttonmcchat.ChatFormatter.Format;
|
||||||
|
import buttondevteam.thebuttonmcchat.ChatFormatter.Priority;
|
||||||
|
|
||||||
|
public class ChatFormatterBuilder {
|
||||||
|
private Pattern regex;
|
||||||
|
private Format format;
|
||||||
|
private Color color;
|
||||||
|
private Predicate<String> onmatch;
|
||||||
|
private String openlink;
|
||||||
|
private Priority priority;
|
||||||
|
private String replacewith;
|
||||||
|
|
||||||
|
public ChatFormatter build() {
|
||||||
|
return new ChatFormatter(regex, format, color, onmatch, openlink, priority, replacewith);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pattern getRegex() {
|
||||||
|
return regex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChatFormatterBuilder setRegex(Pattern regex) {
|
||||||
|
this.regex = regex;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Format getFormat() {
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChatFormatterBuilder setFormat(Format format) {
|
||||||
|
this.format = format;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Color getColor() {
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChatFormatterBuilder setColor(Color color) {
|
||||||
|
this.color = color;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Predicate<String> getOnmatch() {
|
||||||
|
return onmatch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChatFormatterBuilder setOnmatch(Predicate<String> onmatch) {
|
||||||
|
this.onmatch = onmatch;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenlink() {
|
||||||
|
return openlink;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChatFormatterBuilder setOpenlink(String openlink) {
|
||||||
|
this.openlink = openlink;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Priority getPriority() {
|
||||||
|
return priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChatFormatterBuilder setPriority(Priority priority) {
|
||||||
|
this.priority = priority;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReplacewith() {
|
||||||
|
return replacewith;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChatFormatterBuilder setReplacewith(String replacewith) {
|
||||||
|
this.replacewith = replacewith;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
|
@ -69,7 +69,8 @@ public class ChatProcessing {
|
||||||
colormode = ChatFormatter.Color.Green;
|
colormode = ChatFormatter.Color.Green;
|
||||||
// If greentext, ignore channel or player colors
|
// If greentext, ignore channel or player colors
|
||||||
|
|
||||||
formatters.add(new ChatFormatter(Pattern.compile(".+"), colormode, "", Priority.Low));
|
formatters.add(new ChatFormatterBuilder().setRegex(Pattern.compile(".+")).setColor(colormode)
|
||||||
|
.setPriority(Priority.Low).build());
|
||||||
|
|
||||||
String formattedmessage = message;
|
String formattedmessage = message;
|
||||||
formattedmessage = formattedmessage.replace("\\", "\\\\");
|
formattedmessage = formattedmessage.replace("\\", "\\\\");
|
||||||
|
@ -78,16 +79,19 @@ public class ChatProcessing {
|
||||||
|
|
||||||
String suggestmsg = formattedmessage;
|
String suggestmsg = formattedmessage;
|
||||||
|
|
||||||
formatters.add(new ChatFormatter(Pattern.compile("(?<!\\\\)\\*\\*((?:\\\\\\*|[^\\*])+[^\\*\\\\])\\*\\*"),
|
formatters.add(new ChatFormatterBuilder()
|
||||||
ChatFormatter.Format.Bold, "$1"));
|
.setRegex(Pattern.compile("(?<!\\\\)\\*\\*((?:\\\\\\*|[^\\*])+[^\\*\\\\])\\*\\*"))
|
||||||
formatters.add(new ChatFormatter(Pattern.compile("(?<!\\\\)\\*((?:\\\\\\*|[^\\*])+[^\\*\\\\])\\*"),
|
.setFormat(ChatFormatter.Format.Bold).setReplacewith("$1").build());
|
||||||
ChatFormatter.Format.Italic, "$1"));
|
formatters.add(
|
||||||
formatters.add(new ChatFormatter(Pattern.compile("(?<!\\\\)\\_((?:\\\\\\_|[^\\_])+[^\\_\\\\])\\_"),
|
new ChatFormatterBuilder().setRegex(Pattern.compile("(?<!\\\\)\\*((?:\\\\\\*|[^\\*])+[^\\*\\\\])\\*"))
|
||||||
ChatFormatter.Format.Underlined, "$1"));
|
.setFormat(ChatFormatter.Format.Italic).setReplacewith("$1").build());
|
||||||
|
formatters.add(
|
||||||
|
new ChatFormatterBuilder().setRegex(Pattern.compile("(?<!\\\\)\\_((?:\\\\\\_|[^\\_])+[^\\_\\\\])\\_"))
|
||||||
|
.setFormat(ChatFormatter.Format.Underlined).setReplacewith("$1").build());
|
||||||
|
|
||||||
// URLs + Rainbow text
|
// URLs + Rainbow text
|
||||||
formatters.add(new ChatFormatter(Pattern.compile("(http[\\w:/?=$\\-_.+!*'(),]+)"),
|
formatters.add(new ChatFormatterBuilder().setRegex(Pattern.compile("(http[\\w:/?=$\\-_.+!*'(),]+)"))
|
||||||
ChatFormatter.Format.Underlined, "$1"));
|
.setFormat(ChatFormatter.Format.Underlined).setReplacewith("$1").build());
|
||||||
/*
|
/*
|
||||||
* formattedmessage = formattedmessage .replace( item, String.format(
|
* formattedmessage = formattedmessage .replace( item, String.format(
|
||||||
* "\",\"color\":\"%s\"},{\"text\":\"%s\",\"color\":\"%s\",\"underlined\":\"true\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"%s\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Open URL\",\"color\":\"blue\"}]}}},{\"text\":\""
|
* "\",\"color\":\"%s\"},{\"text\":\"%s\",\"color\":\"%s\",\"underlined\":\"true\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"%s\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Open URL\",\"color\":\"blue\"}]}}},{\"text\":\""
|
||||||
|
@ -102,8 +106,8 @@ public class ChatProcessing {
|
||||||
sb.deleteCharAt(sb.length() - 1);
|
sb.deleteCharAt(sb.length() - 1);
|
||||||
sb.append(")");
|
sb.append(")");
|
||||||
|
|
||||||
formatters
|
formatters.add(new ChatFormatterBuilder().setRegex(Pattern.compile(sb.toString()))
|
||||||
.add(new ChatFormatter(Pattern.compile(sb.toString()), ChatFormatter.Color.Aqua, (String match) -> {
|
.setColor(ChatFormatter.Color.Aqua).setOnmatch((String match) -> {
|
||||||
Player p = Bukkit.getPlayer(match);
|
Player p = Bukkit.getPlayer(match);
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
PluginMain.Instance.getLogger()
|
PluginMain.Instance.getLogger()
|
||||||
|
@ -119,10 +123,10 @@ public class ChatProcessing {
|
||||||
(float) PlayerListener.NotificationPitch);
|
(float) PlayerListener.NotificationPitch);
|
||||||
String color = String.format("§%x", (mpp.GetFlairColor() == 0x00 ? 0xb : mpp.GetFlairColor()));
|
String color = String.format("§%x", (mpp.GetFlairColor() == 0x00 ? 0xb : mpp.GetFlairColor()));
|
||||||
return true; // TODO
|
return true; // TODO
|
||||||
}, Priority.High));
|
}).setPriority(Priority.High).build());
|
||||||
|
|
||||||
formatters
|
formatters.add(new ChatFormatterBuilder().setRegex(Pattern.compile(sb.toString()))
|
||||||
.add(new ChatFormatter(Pattern.compile(sb.toString()), ChatFormatter.Color.Aqua, (String match) -> {
|
.setColor(ChatFormatter.Color.Aqua).setOnmatch((String match) -> {
|
||||||
for (String n : PlayerListener.nicknames.keySet()) {
|
for (String n : PlayerListener.nicknames.keySet()) {
|
||||||
String nwithoutformatting = new String(n);
|
String nwithoutformatting = new String(n);
|
||||||
int index;
|
int index;
|
||||||
|
@ -155,32 +159,27 @@ public class ChatProcessing {
|
||||||
(mpp.GetFlairColor() == 0x00 ? 0xb : mpp.GetFlairColor()));
|
(mpp.GetFlairColor() == 0x00 ? 0xb : mpp.GetFlairColor()));
|
||||||
}
|
}
|
||||||
return true; // TODO
|
return true; // TODO
|
||||||
}, Priority.High));
|
}).setPriority(Priority.High).build());
|
||||||
}
|
}
|
||||||
|
|
||||||
pingedconsole = false;
|
pingedconsole = false;
|
||||||
formatters.add(new ChatFormatter(Pattern.compile("(?i)" + Pattern.quote("@console")), ChatFormatter.Color.Aqua,
|
formatters.add(new ChatFormatterBuilder().setRegex(Pattern.compile("(?i)" + Pattern.quote("@console")))
|
||||||
(String match) -> {
|
.setColor(ChatFormatter.Color.Aqua).setOnmatch((String match) -> {
|
||||||
if (!pingedconsole) {
|
if (!pingedconsole) {
|
||||||
System.out.print("\007");
|
System.out.print("\007");
|
||||||
pingedconsole = true;
|
pingedconsole = true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}, Priority.High));
|
}).setPriority(Priority.High).build());
|
||||||
|
|
||||||
formatters.add(new ChatFormatter(Pattern.compile("#(\\w+)"), ChatFormatter.Color.Blue,
|
formatters
|
||||||
"https://twitter.com/hashtag/$1", Priority.High));
|
.add(new ChatFormatterBuilder().setRegex(Pattern.compile("#(\\w+)")).setColor(ChatFormatter.Color.Blue)
|
||||||
|
.setOpenlink("https://twitter.com/hashtag/$1").setPriority(Priority.High).build());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* if (!hadurls) {
|
* if (!hadurls) { if (formattedmessage.matches("(?i).*" + Pattern.quote("@console") + ".*")) { formattedmessage = formattedmessage.replaceAll( "(?i)" + Pattern.quote("@console"),
|
||||||
*
|
* "§b@console§r"); formattedmessage = formattedmessage .replaceAll( "(?i)" + Pattern.quote("@console"), String.format(
|
||||||
* if (formattedmessage.matches("(?i).*" + Pattern.quote("@console") +
|
* "\",\"color\":\"%s\"},{\"text\":\"§b@console§r\",\"color\":\"blue\"},{\"text\":\"" , colormode)); System.out.println("\007"); } }
|
||||||
* ".*")) { formattedmessage = formattedmessage.replaceAll( "(?i)" +
|
|
||||||
* Pattern.quote("@console"), "§b@console§r"); formattedmessage =
|
|
||||||
* formattedmessage .replaceAll( "(?i)" + Pattern.quote("@console"),
|
|
||||||
* String.format(
|
|
||||||
* "\",\"color\":\"%s\"},{\"text\":\"§b@console§r\",\"color\":\"blue\"},{\"text\":\""
|
|
||||||
* , colormode)); System.out.println("\007"); } }
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
StringBuilder json = new StringBuilder();
|
StringBuilder json = new StringBuilder();
|
||||||
|
@ -207,24 +206,16 @@ public class ChatProcessing {
|
||||||
json.append("{\"text\":\"> \",\"color\":\"white\"}");
|
json.append("{\"text\":\"> \",\"color\":\"white\"}");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* int index = -1; ArrayList<String> list = new ArrayList<String>();
|
* int index = -1; ArrayList<String> list = new ArrayList<String>(); while ((index = message.indexOf("#", index + 1)) != -1) { int index2 = message.indexOf(" ", index + 1); if (index2 == -1)
|
||||||
* while ((index = message.indexOf("#", index + 1)) != -1) { int index2
|
* index2 = message.length(); int index3 = message.indexOf("#", index + 1); if (index3 != -1 && index3 < index2) // A # occurs before a // space index2 = index3; String original =
|
||||||
* = message.indexOf(" ", index + 1); if (index2 == -1) index2 =
|
* message.substring(index + 1, index2); list.add(original); } if (!hadurls) { for (String original : list) // Hashtags formattedmessage = formattedmessage .replace( "#" + original,
|
||||||
* message.length(); int index3 = message.indexOf("#", index + 1); if
|
|
||||||
* (index3 != -1 && index3 < index2) // A # occurs before a // space
|
|
||||||
* index2 = index3; String original = message.substring(index + 1,
|
|
||||||
* index2); list.add(original); }
|
|
||||||
*
|
|
||||||
* if (!hadurls) { for (String original : list) // Hashtags
|
|
||||||
* formattedmessage = formattedmessage .replace( "#" + original,
|
|
||||||
* String.format(
|
* String.format(
|
||||||
* "\",\"color\":\"%s\"},{\"text\":\"#%s\",\"color\":\"blue\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://twitter.com/hashtag/%s\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Open on Twitter\",\"color\":\"blue\"}]}}},{\"text\":\""
|
* "\",\"color\":\"%s\"},{\"text\":\"#%s\",\"color\":\"blue\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://twitter.com/hashtag/%s\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Open on Twitter\",\"color\":\"blue\"}]}}},{\"text\":\""
|
||||||
* , colormode, original, original)); }
|
* , colormode, original, original)); }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* json.append(String.format("{\"text\":\"%s\",\"color\":\"%s\"}]",
|
* json.append(String.format("{\"text\":\"%s\",\"color\":\"%s\"}]", ChatFormatter.Combine(formatters, formattedmessage), colormode));
|
||||||
* ChatFormatter.Combine(formatters, formattedmessage), colormode));
|
|
||||||
*/
|
*/
|
||||||
json.append(ChatFormatter.Combine(formatters, formattedmessage));
|
json.append(ChatFormatter.Combine(formatters, formattedmessage));
|
||||||
json.append("]");
|
json.append("]");
|
||||||
|
|
|
@ -24,7 +24,6 @@ import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
import org.bukkit.event.player.PlayerChatTabCompleteEvent;
|
import org.bukkit.event.player.PlayerChatTabCompleteEvent;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
@ -35,8 +34,6 @@ import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.SkullMeta;
|
import org.bukkit.inventory.meta.SkullMeta;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import au.com.mineauz.minigames.MinigamePlayer;
|
import au.com.mineauz.minigames.MinigamePlayer;
|
||||||
import au.com.mineauz.minigames.Minigames;
|
import au.com.mineauz.minigames.Minigames;
|
||||||
import buttondevteam.bucket.core.TBMCPlayer;
|
import buttondevteam.bucket.core.TBMCPlayer;
|
||||||
|
|
|
@ -4,7 +4,6 @@ import net.milkbowl.vault.chat.Chat;
|
||||||
import net.milkbowl.vault.economy.Economy;
|
import net.milkbowl.vault.economy.Economy;
|
||||||
import net.milkbowl.vault.permission.Permission;
|
import net.milkbowl.vault.permission.Permission;
|
||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
import org.bukkit.configuration.InvalidConfigurationException;
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
|
|
|
@ -1,16 +1,7 @@
|
||||||
package buttondevteam.thebuttonmcchat.commands.ucmds.admin;
|
package buttondevteam.thebuttonmcchat.commands.ucmds.admin;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
import buttondevteam.bucket.core.TBMCCoreAPI;
|
import buttondevteam.bucket.core.TBMCCoreAPI;
|
||||||
import buttondevteam.thebuttonmcchat.PluginMain;
|
|
||||||
|
|
||||||
public class UpdatePlugin extends AdminCommandBase {
|
public class UpdatePlugin extends AdminCommandBase {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue