diff --git a/TheButtonAutoFlair.jar b/TheButtonAutoFlair.jar index d652e74..08a6ebd 100644 Binary files a/TheButtonAutoFlair.jar and b/TheButtonAutoFlair.jar differ diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java index 3798da1..3302409 100644 --- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java +++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java @@ -80,7 +80,7 @@ public class PlayerListener implements Listener { // 2015.07.16. @Override public void run() { if (mp.FlairState.equals(FlairStates.NoComment)) { - String json = "[\"\",{\"text\":\"If you'd like your /r/TheButton flair displayed ingame, write your Minecraft name to \",\"color\":\"aqua\"},{\"text\":\"[this thread].\",\"color\":\"aqua\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread\",\"color\":\"aqua\"}]}}}]"; + String json = String.format("[\"\",{\"text\":\"If you'd like your /r/TheButton flair displayed ingame, write your Minecraft name to \",\"color\":\"aqua\"},{\"text\":\"[this thread].\",\"color\":\"aqua\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"%s\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click here to go to the Reddit thread\",\"color\":\"aqua\"}]}}}]", PluginMain.FlairThreadURL); PluginMain.Instance.getServer().dispatchCommand( PluginMain.Console, "tellraw " + mp.PlayerName + " " + json); @@ -353,7 +353,7 @@ public class PlayerListener implements Listener { // 2015.07.16. json.append(String.format("{\"text\":\"%s\",\"color\":\"%s\"}]", formattedmessage, (greentext ? "green" : player.CurrentChannel.Color))); - //System.out.println(formattedmessage); // TO!DO: TMP + // System.out.println(formattedmessage); // TO!DO: TMP if (player.CurrentChannel.equals(Channel.TownChat) || player.CurrentChannel.equals(Channel.NationChat)) // for (Resident resident : @@ -561,7 +561,7 @@ public class PlayerListener implements Listener { // 2015.07.16. } else PluginMain.Instance.getServer().dispatchCommand(PluginMain.Console, String.format("tellraw @a %s", json.toString())); - //System.out.println("JSON: " + json); // TO!DO: TMP + // System.out.println("JSON: " + json); // TO!DO: TMP PluginMain.Instance .getServer() .getConsoleSender() diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PluginMain.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PluginMain.java index 3e30f6f..9fb3aae 100644 --- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PluginMain.java +++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PluginMain.java @@ -43,6 +43,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15. public static PluginMain Instance; public static ConsoleCommandSender Console; // 2015.08.12. public static Scoreboard SB; + public final static String FlairThreadURL = "https://www.reddit.com/r/TheButtonMinecraft/comments/433ptk/autoflair_thread/"; public TownyUniverse TU; public ArrayList Towns; public ArrayList Nations; @@ -139,7 +140,8 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15. private void ThreadMethod() { while (!stop) { try { - String body = DownloadString("https://www.reddit.com/r/TheButtonMinecraft/comments/3d25do/autoflair_system_comment_your_minecraft_name_and/.json?limit=1000"); + String body = DownloadString(FlairThreadURL + + ".json?limit=1000"); JSONArray json = new JSONArray(body).getJSONObject(1) .getJSONObject("data").getJSONArray("children"); for (Object obj : json) { diff --git a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$2.class b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$2.class index 0aca41d..6b4610c 100644 Binary files a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$2.class and b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener$2.class differ diff --git a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain$1.class b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain$1.class index 91a955b..ce69bd9 100644 Binary files a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain$1.class and b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain$1.class differ diff --git a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain$2.class b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain$2.class index 661065f..fe2d271 100644 Binary files a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain$2.class and b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain$2.class differ diff --git a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain.class b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain.class index c02ae22..887f7cd 100644 Binary files a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain.class and b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PluginMain.class differ