Remove htmlcleaner and fix #117

This commit is contained in:
Norbi Peti 2020-08-26 22:19:12 +02:00
parent 02423153de
commit 4d4448fca1
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
4 changed files with 7 additions and 42 deletions

32
pom.xml
View file

@ -31,26 +31,6 @@
</resources> </resources>
<finalName>Chroma-Chat</finalName> <finalName>Chroma-Chat</finalName>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>net.sourceforge.htmlcleaner:htmlcleaner</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
@ -192,18 +172,6 @@
<artifactId>Chroma-Core</artifactId> <artifactId>Chroma-Core</artifactId>
<version>${branch}-SNAPSHOT</version> <version>${branch}-SNAPSHOT</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/net.sourceforge.htmlcleaner/htmlcleaner -->
<dependency>
<groupId>net.sourceforge.htmlcleaner</groupId>
<artifactId>htmlcleaner</artifactId>
<version>2.16</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.reflections/reflections -->
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.10</version>
</dependency>
<dependency> <dependency>
<groupId>net.ess3</groupId> <groupId>net.ess3</groupId>
<artifactId>EssentialsX</artifactId> <artifactId>EssentialsX</artifactId>

View file

@ -12,16 +12,11 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParser; import com.google.gson.JsonParser;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.htmlcleaner.HtmlCleaner;
import org.htmlcleaner.TagNode;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.text.SimpleDateFormat; import java.util.HashSet;
import java.util.*; 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. * 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<PluginMain> {
} }
private static boolean JoinedBefore(ChatPlayer mp, int year, int month, int day) throws Exception { 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(); URLConnection con = url.openConnection();
con.setRequestProperty("User-Agent", "TheButtonAutoFlair"); con.setRequestProperty("User-Agent", "TheButtonAutoFlair");
InputStream in = con.getInputStream(); InputStream in = con.getInputStream();
@ -180,7 +175,8 @@ public class FlairComponent extends Component<PluginMain> {
joindate = joindate.split("T")[0]; joindate = joindate.split("T")[0];
Date date = parserSDF.parse(joindate); Date date = parserSDF.parse(joindate);
return date.before(new Calendar.Builder().setTimeZone(TimeZone.getTimeZone("UTC")).setDate(year, month, day) 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) { public static void ConfirmUserMessage(ChatPlayer mp) {

View file

@ -111,6 +111,7 @@ public class TownColorComponent extends Component<PluginMain> implements Listene
if (useNationColors().get()) if (useNationColors().get())
getConfig().getConfig().createSection("nationcolors", NationColor.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, getConfig().getConfig().createSection("nationcolors", NationColor.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey,
v -> v.getValue().toString()))); v -> v.getValue().toString())));
getConfig().signalChange();
} }
private void initDynmap() { private void initDynmap() {

View file

@ -36,9 +36,9 @@ depend:
- Vault - Vault
- ChromaCore - ChromaCore
soft-depend: soft-depend:
- Minigames
- Dynmap-Towny - Dynmap-Towny
- Towny - Towny
- dynmap
permissions: permissions:
tbmc.badge.gold: tbmc.badge.gold:
description: Gives a patron badge. description: Gives a patron badge.