Skip to content

Commit

Permalink
Fix for saving unicode characters in YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed Oct 18, 2018
1 parent a9f5c38 commit 3b9b4ac
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
Expand Up @@ -101,9 +101,9 @@ public String toString() {

protected static DumperOptions getDumperOptions() {
DumperOptions options = new DumperOptions();
options.setAllowUnicode(true);
options.setAllowUnicode(false);
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
options.setIndent(4);
options.setIndent(2);

return options;
}
Expand Down
Expand Up @@ -38,7 +38,7 @@ public void listCommand(CommandSender sender, String label) {
message.setColor(ChatColor.GOLD);
hover.setColor(ChatColor.GOLD);
hoverm.add(hover);
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Group-Menu.Group-Server-Count").replace("$int$", new DecimalFormat("#,###").format(groups.get(group).size())));
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Group-Menu.Group-Server-Count").replace("$int$", new DecimalFormat("#,###").format(groups.get(group).size())) + ChatColor.RESET);
hoverm.add(hover);
message.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, label + " open Server 1 " + group));
message.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverm.toArray(new TextComponent[hoverm.size()])));
Expand All @@ -65,7 +65,7 @@ public void listCommand(CommandSender sender, String label) {
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary") + '\n');
hoverm.add(hover);
}
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(server.getPlayers().size())));
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(server.getPlayers().size())) + ChatColor.RESET);
} else if (((SubServer) server).isEnabled() && ((SubServer) server).getCurrentIncompatibilities().size() == 0) {
message.setColor(ChatColor.YELLOW);
hover.setColor(ChatColor.YELLOW);
Expand Down Expand Up @@ -118,7 +118,7 @@ public void listCommand(CommandSender sender, String label) {
hoverm.add(hover);
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External") + '\n');
hoverm.add(hover);
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(server.getPlayers().size())));
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(server.getPlayers().size())) + ChatColor.RESET);
hoverm.add(hover);
if (plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false)) {
hover = new TextComponent('\n' + server.getAddress().getAddress().getHostAddress() + ':' + server.getAddress().getPort());
Expand Down Expand Up @@ -156,7 +156,7 @@ public void listCommand(CommandSender sender, String label) {
hover.setColor(ChatColor.GRAY);
hoverm.add(hover);
}
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Host-Menu.Host-Server-Count").replace("$int$", new DecimalFormat("#,###").format(host.getSubServers().keySet().size())));
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Host-Menu.Host-Server-Count").replace("$int$", new DecimalFormat("#,###").format(host.getSubServers().keySet().size())) + ChatColor.RESET);
} else {
message.setColor(ChatColor.RED);
hover.setColor(ChatColor.RED);
Expand Down Expand Up @@ -199,7 +199,7 @@ public void listCommand(CommandSender sender, String label) {
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.SubServer-Temporary") + '\n');
hoverm.add(hover);
}
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(subserver.getPlayers().size())));
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(subserver.getPlayers().size())) + ChatColor.RESET);
} else if (subserver.isEnabled() && subserver.getCurrentIncompatibilities().size() == 0) {
message.setColor(ChatColor.YELLOW);
hover.setColor(ChatColor.YELLOW);
Expand Down Expand Up @@ -268,7 +268,7 @@ public void listCommand(CommandSender sender, String label) {
}
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-External") + '\n');
hoverm.add(hover);
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(server.getPlayers().size())));
hover = new TextComponent(plugin.api.getLang("SubServers", "Interface.Server-Menu.Server-Player-Count").replace("$int$", new DecimalFormat("#,###").format(server.getPlayers().size())) + ChatColor.RESET);
hoverm.add(hover);
if (plugin.config.get().getSection("Settings").getBoolean("Show-Addresses", false)) {
hover = new TextComponent('\n' + server.getAddress().getAddress().getHostAddress()+':'+server.getAddress().getPort());
Expand Down Expand Up @@ -299,7 +299,7 @@ public void listCommand(CommandSender sender, String label) {
hoverm.add(hover);
hover = new TextComponent('\n' + plugin.api.getLang("SubServers", "Interface.Proxy-Menu.Proxy-Master"));
hoverm.add(hover);
hover = new TextComponent('\n' + plugin.api.getLang("SubServers", "Interface.Proxy-Menu.Proxy-Player-Count").replace("$int$", new DecimalFormat("#,###").format(proxymaster.getPlayers().size())));
hover = new TextComponent('\n' + plugin.api.getLang("SubServers", "Interface.Proxy-Menu.Proxy-Player-Count").replace("$int$", new DecimalFormat("#,###").format(proxymaster.getPlayers().size())) + ChatColor.RESET);
hoverm.add(hover);
} else {
hover = new TextComponent('\n' + plugin.api.getLang("SubServers", "Interface.Proxy-Menu.Proxy-Master"));
Expand Down
Expand Up @@ -101,9 +101,9 @@ public String toString() {

protected static DumperOptions getDumperOptions() {
DumperOptions options = new DumperOptions();
options.setAllowUnicode(true);
options.setAllowUnicode(false);
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
options.setIndent(4);
options.setIndent(2);

return options;
}
Expand Down
Expand Up @@ -101,9 +101,9 @@ public String toString() {

protected static DumperOptions getDumperOptions() {
DumperOptions options = new DumperOptions();
options.setAllowUnicode(true);
options.setAllowUnicode(false);
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
options.setIndent(4);
options.setIndent(2);

return options;
}
Expand Down
2 changes: 1 addition & 1 deletion SubServers.Host/pom.xml
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>net.ME1312.Galaxi</groupId>
<artifactId>GalaxiEngine</artifactId>
<version>18w40a</version>
<version>18w42a</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Expand Up @@ -101,9 +101,9 @@ public String toString() {

protected static DumperOptions getDumperOptions() {
DumperOptions options = new DumperOptions();
options.setAllowUnicode(true);
options.setAllowUnicode(false);
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
options.setIndent(4);
options.setIndent(2);

return options;
}
Expand Down

0 comments on commit 3b9b4ac

Please sign in to comment.