From ae1701613b1aa5ed581d1f0806ca105e84082dee Mon Sep 17 00:00:00 2001 From: Robinson Gallego Date: Wed, 31 Jul 2019 12:19:23 -0400 Subject: [PATCH] ok fixed some bugs Signed-off-by: Robinson Gallego --- .../command/Command_blockedit.java | 4 +-- .../command/Command_colorme.java | 2 +- .../command/Command_consolesay.java | 2 +- .../command/Command_debug.java | 4 +-- .../command/Command_dispfill.java | 2 +- .../command/Command_eject.java | 2 +- .../command/Command_findip.java | 2 +- .../totalfreedommod/command/Command_gtfo.java | 2 +- .../command/Command_invis.java | 2 +- .../command/Command_modifyitem.java | 2 +- .../command/Command_nickfilter.java | 2 +- .../command/Command_plugincontrol.java | 2 +- .../command/Command_potion.java | 2 +- .../command/Command_premium.java | 29 +++++++++++++++---- .../command/Command_protectarea.java | 2 +- .../command/Command_qdeop.java | 2 +- .../totalfreedommod/command/Command_qop.java | 2 +- .../command/Command_report.java | 4 +-- .../totalfreedommod/command/Command_stfu.java | 2 +- .../totalfreedommod/command/Command_stop.java | 2 +- .../totalfreedommod/command/Command_tag.java | 2 +- .../command/Command_tagnyan.java | 2 +- .../command/Command_tagrainbow.java | 2 +- .../command/Command_tempban.java | 2 +- .../totalfreedommod/httpd/HTTPDaemon.java | 2 +- .../httpd/module/Module_file.java | 2 +- .../httpd/module/Module_help.java | 2 +- .../totalfreedommod/util/History.java | 4 +++ src/main/resources/plugin.yml | 2 +- 29 files changed, 57 insertions(+), 36 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_blockedit.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_blockedit.java index 6e62c10d..743a7e10 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_blockedit.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_blockedit.java @@ -3,8 +3,8 @@ package me.totalfreedom.totalfreedommod.command; import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_colorme.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_colorme.java index b6734dcf..01a8df94 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_colorme.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_colorme.java @@ -4,7 +4,7 @@ import java.util.Iterator; import java.util.Map; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_consolesay.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_consolesay.java index 06691130..061ccedd 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_consolesay.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_consolesay.java @@ -2,7 +2,7 @@ package me.totalfreedom.totalfreedommod.command; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_debug.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_debug.java index 7af987a2..90e51a0a 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_debug.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_debug.java @@ -2,8 +2,8 @@ package me.totalfreedom.totalfreedommod.command; import java.lang.reflect.Field; import me.totalfreedom.totalfreedommod.rank.Rank; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_dispfill.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_dispfill.java index 2ff17097..93f7df4a 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_dispfill.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_dispfill.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.List; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_eject.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_eject.java index 2e321080..e6e35053 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_eject.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_eject.java @@ -3,7 +3,7 @@ package me.totalfreedom.totalfreedommod.command; import java.util.ArrayList; import java.util.List; import me.totalfreedom.totalfreedommod.rank.Rank; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_findip.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_findip.java index 6c209106..c1e4d4c8 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_findip.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_findip.java @@ -1,7 +1,7 @@ package me.totalfreedom.totalfreedommod.command; import me.totalfreedom.totalfreedommod.rank.Rank; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java index 4a8a4896..b327039c 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_gtfo.java @@ -10,7 +10,7 @@ import me.totalfreedom.totalfreedommod.punishments.Punishment; import me.totalfreedom.totalfreedommod.punishments.PunishmentType; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.GameMode; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java index 5fc69be6..9895f671 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_invis.java @@ -6,7 +6,7 @@ import java.util.Collections; import java.util.List; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_modifyitem.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_modifyitem.java index 27e25456..e95cfd4e 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_modifyitem.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_modifyitem.java @@ -8,7 +8,7 @@ import net.minecraft.server.v1_14_R1.NBTTagCompound; import net.minecraft.server.v1_14_R1.NBTTagInt; import net.minecraft.server.v1_14_R1.NBTTagList; import net.minecraft.server.v1_14_R1.NBTTagString; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickfilter.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickfilter.java index a85809c1..cfd17251 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickfilter.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_nickfilter.java @@ -6,7 +6,7 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import me.totalfreedom.totalfreedommod.rank.Rank; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.Command; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java index 4f9f6d3d..f2c9800f 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java @@ -5,7 +5,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import me.totalfreedom.totalfreedommod.rank.Rank; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java index a9412cf7..1dbadb5d 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_potion.java @@ -6,7 +6,7 @@ import java.util.Collections; import java.util.List; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_premium.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_premium.java index 2c911a42..37945a3e 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_premium.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_premium.java @@ -1,7 +1,9 @@ package me.totalfreedom.totalfreedommod.command; import java.io.BufferedReader; +import java.io.FileNotFoundException; import java.io.InputStreamReader; +import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import me.totalfreedom.totalfreedommod.rank.Rank; @@ -44,15 +46,30 @@ public class Command_premium extends FreedomCommand { try { - final URL getUrl = new URL("http://axis.iaero.me/accstatus?username=" + name + "&format=plain"); - final URLConnection urlConnection = getUrl.openConnection(); + final URL getUrl = new URL("https://api.ashcon.app/mojang/v2/user/" + name); + final HttpURLConnection urlConnection = (HttpURLConnection)getUrl.openConnection(); + urlConnection.setRequestProperty("User-Agent", ""); final String message; - try ( // Read the response - BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()))) + String message1; + try //( // Read the response + //BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()))) { - message = (!"PREMIUM".equalsIgnoreCase(in.readLine()) ? ChatColor.RED + "No" : ChatColor.DARK_GREEN + "Yes"); + if (urlConnection.getResponseCode() == 200) + { + message1 = ChatColor.GREEN + "Yes"; + } + else + { + message1 = ChatColor.RED + "No"; + } + //message = (!"PREMIUM".equalsIgnoreCase(in.readLine()) ? ChatColor.RED + "No" : ChatColor.DARK_GREEN + "Yes"); + } + catch (Exception e){ + message1 = ChatColor.RED + "There was an error on trying to connect to the API server"; } + + message = message1; if (!plugin.isEnabled()) { return; @@ -71,7 +88,7 @@ public class Command_premium extends FreedomCommand catch (Exception ex) { FLog.severe(ex); - msg("There was an error querying the Mojang server.", ChatColor.RED); + msg("There was an error querying the API server.", ChatColor.RED); } } }.runTaskAsynchronously(plugin); diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_protectarea.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_protectarea.java index c59351bf..2caa548a 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_protectarea.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_protectarea.java @@ -3,7 +3,7 @@ package me.totalfreedom.totalfreedommod.command; import me.totalfreedom.totalfreedommod.ProtectArea; import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.rank.Rank; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_qdeop.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_qdeop.java index 64770617..9efb7cce 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_qdeop.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_qdeop.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.List; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_qop.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_qop.java index b0297aec..61a404b4 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_qop.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_qop.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.List; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_report.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_report.java index 1cfd6b97..4753a391 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_report.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_report.java @@ -1,8 +1,8 @@ package me.totalfreedom.totalfreedommod.command; import me.totalfreedom.totalfreedommod.rank.Rank; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_stfu.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_stfu.java index dfd711f5..647bb011 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_stfu.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_stfu.java @@ -11,7 +11,7 @@ import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; import net.pravian.aero.util.Ips; import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_stop.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_stop.java index 368795b7..3d4137f1 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_stop.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_stop.java @@ -2,7 +2,7 @@ package me.totalfreedom.totalfreedommod.command; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tag.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tag.java index 64677b75..20a9d420 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tag.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tag.java @@ -9,7 +9,7 @@ import me.totalfreedom.totalfreedommod.playerverification.VPlayer; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tagnyan.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tagnyan.java index dd536709..a1d62465 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tagnyan.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tagnyan.java @@ -3,7 +3,7 @@ package me.totalfreedom.totalfreedommod.command; import me.totalfreedom.totalfreedommod.player.FPlayer; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tagrainbow.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tagrainbow.java index 551106b4..57cc6bf9 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tagrainbow.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tagrainbow.java @@ -2,7 +2,7 @@ package me.totalfreedom.totalfreedommod.command; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tempban.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tempban.java index f3aeadac..fa24bbfc 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tempban.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_tempban.java @@ -11,7 +11,7 @@ import me.totalfreedom.totalfreedommod.punishments.PunishmentType; import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.util.FUtil; import net.pravian.aero.util.Ips; -import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import org.bukkit.Location; import org.bukkit.command.Command; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/HTTPDaemon.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/HTTPDaemon.java index 1b0f6741..da1665ec 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/HTTPDaemon.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/HTTPDaemon.java @@ -27,7 +27,7 @@ import me.totalfreedom.totalfreedommod.httpd.module.Module_schematic; import me.totalfreedom.totalfreedommod.util.FLog; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang3.exception.ExceptionUtils; +import org.apache.commons.lang.exception.ExceptionUtils; public class HTTPDaemon extends FreedomService { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_file.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_file.java index c8f09c15..732613d2 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_file.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_file.java @@ -17,7 +17,7 @@ import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Response; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; /* * This class was adapted from https://github.com/NanoHttpd/nanohttpd/blob/master/webserver/src/main/java/fi/iki/elonen/SimpleWebServer.java diff --git a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_help.java b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_help.java index f420f0f9..703b0b7e 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_help.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/httpd/module/Module_help.java @@ -13,7 +13,7 @@ import me.totalfreedom.totalfreedommod.command.FreedomCommand; import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD; import me.totalfreedom.totalfreedommod.rank.Displayable; import net.pravian.aero.command.CommandReflection; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandMap; import org.bukkit.command.PluginIdentifiableCommand; diff --git a/src/main/java/me/totalfreedom/totalfreedommod/util/History.java b/src/main/java/me/totalfreedom/totalfreedommod/util/History.java index d46d180e..42b1a4aa 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/util/History.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/util/History.java @@ -35,8 +35,12 @@ public class History String compactUuid = uuid.toString().replace("-", ""); try { + //UUIDs or playernames actually work with this one + //TODO: fix the stupid api on how it's not working name histories + //URL url = new URL("https://api.ashcon.app/mojang/v2/user/" + compactUuid); URL url = new URL("https://api.mojang.com/user/profiles/" + compactUuid + "/names"); HttpURLConnection conn = (HttpURLConnection)url.openConnection(); + //conn.setRequestProperty("User-Agent", ""); BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); FName[] oldNames = gson.fromJson(reader, FName[].class); if (oldNames == null) diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 02856336..7dfa6193 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -5,4 +5,4 @@ description: Plugin for the Total Freedom server. depend: [Aero] softdepend: [BukkitTelnet, Essentials, LibsDisguises, WorldEdit] authors: [Madgeek1450, Prozza] -api-version: 1.13 +api-version: 1.14