From f2daaeefcd0d87b582517541bedc7f7cb8dcf567 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 17 Dec 2013 08:11:30 +1300 Subject: [PATCH] Updated the error message so I can give even less support --- src/me/libraryaddict/disguise/DisguiseListener.java | 8 ++++---- src/me/libraryaddict/disguise/LibsDisguises.java | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/me/libraryaddict/disguise/DisguiseListener.java b/src/me/libraryaddict/disguise/DisguiseListener.java index be0871ee..fcdfdf6c 100644 --- a/src/me/libraryaddict/disguise/DisguiseListener.java +++ b/src/me/libraryaddict/disguise/DisguiseListener.java @@ -27,15 +27,15 @@ public class DisguiseListener implements Listener { private HashMap disguiseRunnable = new HashMap(); private HashMap disguiseSlap = new HashMap(); private String latestVersion; - private String permission; private LibsDisguises plugin; private String updateMessage = ChatColor.RED + "[LibsDisguises] " + ChatColor.DARK_RED + "There is a update ready to be downloaded! You are using " + ChatColor.RED + "v%s" + ChatColor.DARK_RED + ", the new version is " + ChatColor.RED + "%s" + ChatColor.DARK_RED + "!"; + private String updateNotifyPermission; public DisguiseListener(LibsDisguises libsDisguises) { plugin = libsDisguises; - permission = plugin.getConfig().getString("Permission"); + updateNotifyPermission = plugin.getConfig().getString("Permission"); if (plugin.getConfig().getBoolean("NotifyUpdate")) { currentVersion = plugin.getDescription().getVersion(); Bukkit.getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() { @@ -49,7 +49,7 @@ public class DisguiseListener implements Listener { Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { public void run() { for (Player p : Bukkit.getOnlinePlayers()) - if (p.hasPermission(permission)) + if (p.hasPermission(updateNotifyPermission)) p.sendMessage(String.format(updateMessage, currentVersion, latestVersion)); } }); @@ -65,7 +65,7 @@ public class DisguiseListener implements Listener { @EventHandler public void onJoin(PlayerJoinEvent event) { Player p = event.getPlayer(); - if (latestVersion != null && p.hasPermission(permission)) + if (latestVersion != null && p.hasPermission(updateNotifyPermission)) p.sendMessage(String.format(updateMessage, currentVersion, latestVersion)); } diff --git a/src/me/libraryaddict/disguise/LibsDisguises.java b/src/me/libraryaddict/disguise/LibsDisguises.java index 883fa0a1..02838a6d 100644 --- a/src/me/libraryaddict/disguise/LibsDisguises.java +++ b/src/me/libraryaddict/disguise/LibsDisguises.java @@ -196,6 +196,7 @@ public class LibsDisguises extends JavaPlugin { for (WrappedWatchableObject watch : WrappedDataWatcher.getEntityWatcher(bukkitEntity).getWatchableObjects()) { disguiseValues.setMetaValue(watch.getIndex(), watch.getValue()); // Uncomment when I need to find the new datawatcher values for a class.. + // System.out.print("Disguise: " + disguiseType + ", ID: " + watch.getIndex() + ", Class: " // + (watch.getValue() == null ? "null" : watch.getValue()) + ", Value: " + watch.getValue()); } @@ -207,9 +208,13 @@ public class LibsDisguises extends JavaPlugin { } } } catch (Exception ex) { - System.out.print("[LibsDisguises] Trouble while making values for disguise " + disguiseType.name() + ": " - + ex.getMessage()); - System.out.print("[LibsDisguises] Please report this to LibsDisguises author"); + System.out.print("[LibsDisguises] Uh oh! Trouble while making values for the disguise " + disguiseType.name() + + "!"); + System.out.print("[LibsDisguises] Before reporting this error, " + + "please make sure you are using the latest version of LibsDisguises and ProtocolLib"); + System.out + .print("[LibsDisguises] You can also try the latest builds at (ProtocolLib) " + + "http://assets.comphenix.net/job/ProtocolLib/ and (LibsDisguises) http://ci.md-5.net/job/LibsDisguises/"); ex.printStackTrace(); } }