From 3e1df267cff079dd760059bf6d7e7b7ceb2f8563 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sun, 14 May 2017 01:16:54 +0200 Subject: [PATCH] Reduced errors and CMDS WORK - EH --- .../java/buttondevteam/chat/PluginMain.java | 19 ++++++++----------- .../appendtext/AppendTextCommandBase.java | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/main/java/buttondevteam/chat/PluginMain.java b/src/main/java/buttondevteam/chat/PluginMain.java index b6c864f..ffac187 100644 --- a/src/main/java/buttondevteam/chat/PluginMain.java +++ b/src/main/java/buttondevteam/chat/PluginMain.java @@ -40,6 +40,7 @@ import java.lang.String; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; +import java.net.UnknownHostException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; @@ -149,25 +150,21 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15. } PlayersWithFlairs.add(ign); // Don't redownload even if flair isn't accepted } - try { - Thread.sleep(10); - } catch (InterruptedException ex) { - Thread.currentThread().interrupt(); - } - } - try { - Thread.sleep(10000); - } catch (InterruptedException ex) { - Thread.currentThread().interrupt(); } } catch (Exception e) { errorcount++; if (errorcount >= 10) { errorcount = 0; - if (!e.getMessage().contains("Server returned HTTP response code")) + if (!e.getMessage().contains("Server returned HTTP response code") + && !(e instanceof UnknownHostException)) TBMCCoreAPI.SendException("Error while getting flairs from Reddit!", e); } } + try { + Thread.sleep(10000); + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + } } } diff --git a/src/main/java/buttondevteam/chat/commands/appendtext/AppendTextCommandBase.java b/src/main/java/buttondevteam/chat/commands/appendtext/AppendTextCommandBase.java index bcf62d0..5b0c1eb 100644 --- a/src/main/java/buttondevteam/chat/commands/appendtext/AppendTextCommandBase.java +++ b/src/main/java/buttondevteam/chat/commands/appendtext/AppendTextCommandBase.java @@ -11,7 +11,7 @@ import buttondevteam.lib.chat.TBMCChatAPI; import buttondevteam.lib.chat.TBMCCommandBase; import buttondevteam.lib.player.TBMCPlayer; -@CommandClass(modOnly = false) +@CommandClass(modOnly = false, excludeFromPath = true) public abstract class AppendTextCommandBase extends TBMCCommandBase { public abstract String[] GetHelpText(String alias);