Updated the error message so I can give even less support

This commit is contained in:
libraryaddict 2013-12-17 08:11:30 +13:00
parent f4d0af190c
commit f2daaeefcd
2 changed files with 12 additions and 7 deletions

@ -27,15 +27,15 @@ public class DisguiseListener implements Listener {
private HashMap<String, BukkitRunnable> disguiseRunnable = new HashMap<String, BukkitRunnable>();
private HashMap<String, Disguise> disguiseSlap = new HashMap<String, Disguise>();
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));
}

@ -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();
}
}