From 4d4448fca12f8d9ecc1b50c964d2f9fa88607066 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 26 Aug 2020 22:19:12 +0200 Subject: [PATCH] Remove htmlcleaner and fix #117 --- pom.xml | 32 ------------------- .../chat/components/flair/FlairComponent.java | 14 +++----- .../towncolors/TownColorComponent.java | 1 + src/main/resources/plugin.yml | 2 +- 4 files changed, 7 insertions(+), 42 deletions(-) diff --git a/pom.xml b/pom.xml index 5c0de37..81ec68a 100644 --- a/pom.xml +++ b/pom.xml @@ -31,26 +31,6 @@ Chroma-Chat - - org.apache.maven.plugins - maven-shade-plugin - 3.2.1 - - - package - - shade - - - - - net.sourceforge.htmlcleaner:htmlcleaner - - - - - - org.apache.maven.plugins maven-resources-plugin @@ -192,18 +172,6 @@ Chroma-Core ${branch}-SNAPSHOT - - - net.sourceforge.htmlcleaner - htmlcleaner - 2.16 - - - - org.reflections - reflections - 0.9.10 - net.ess3 EssentialsX diff --git a/src/main/java/buttondevteam/chat/components/flair/FlairComponent.java b/src/main/java/buttondevteam/chat/components/flair/FlairComponent.java index 9372ac5..01e8635 100644 --- a/src/main/java/buttondevteam/chat/components/flair/FlairComponent.java +++ b/src/main/java/buttondevteam/chat/components/flair/FlairComponent.java @@ -12,16 +12,11 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import org.bukkit.Bukkit; import org.bukkit.entity.Player; -import org.htmlcleaner.HtmlCleaner; -import org.htmlcleaner.TagNode; import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; import java.net.UnknownHostException; -import java.text.SimpleDateFormat; -import java.util.*; +import java.util.HashSet; +import java.util.Set; /** * This component checks a specific Reddit thread every 10 seconds for comments such as "IGN: NorbiPeti" to link Reddit accounts and to determine their /r/thebutton flair. @@ -166,7 +161,7 @@ public class FlairComponent extends Component { } private static boolean JoinedBefore(ChatPlayer mp, int year, int month, int day) throws Exception { - URL url = new URL("https://www.reddit.com/u/" + mp.UserName()); + /*URL url = new URL("https://www.reddit.com/u/" + mp.UserName()); URLConnection con = url.openConnection(); con.setRequestProperty("User-Agent", "TheButtonAutoFlair"); InputStream in = con.getInputStream(); @@ -180,7 +175,8 @@ public class FlairComponent extends Component { joindate = joindate.split("T")[0]; Date date = parserSDF.parse(joindate); return date.before(new Calendar.Builder().setTimeZone(TimeZone.getTimeZone("UTC")).setDate(year, month, day) - .build().getTime()); + .build().getTime());*/ + return true; } public static void ConfirmUserMessage(ChatPlayer mp) { diff --git a/src/main/java/buttondevteam/chat/components/towncolors/TownColorComponent.java b/src/main/java/buttondevteam/chat/components/towncolors/TownColorComponent.java index bbb2f63..d761438 100644 --- a/src/main/java/buttondevteam/chat/components/towncolors/TownColorComponent.java +++ b/src/main/java/buttondevteam/chat/components/towncolors/TownColorComponent.java @@ -111,6 +111,7 @@ public class TownColorComponent extends Component implements Listene if (useNationColors().get()) getConfig().getConfig().createSection("nationcolors", NationColor.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, v -> v.getValue().toString()))); + getConfig().signalChange(); } private void initDynmap() { diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 7cbaab7..beba4cb 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -36,9 +36,9 @@ depend: - Vault - ChromaCore soft-depend: -- Minigames - Dynmap-Towny - Towny +- dynmap permissions: tbmc.badge.gold: description: Gives a patron badge.