summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-09-05 15:26:33 +0100
committerKHobbits <rob@khobbits.co.uk>2013-09-05 15:40:43 +0100
commit0a17489c9c16d32a8d8fd4a72e0bb4ffa48991a2 (patch)
treecb7e77bd0917755a0fa2501f425657bfc7cd90a8
parent0926da3782c6d82aa54e6a7f68397091315f7d11 (diff)
downloadEssentials-0a17489c9c16d32a8d8fd4a72e0bb4ffa48991a2.tar
Essentials-0a17489c9c16d32a8d8fd4a72e0bb4ffa48991a2.tar.gz
Essentials-0a17489c9c16d32a8d8fd4a72e0bb4ffa48991a2.tar.lz
Essentials-0a17489c9c16d32a8d8fd4a72e0bb4ffa48991a2.tar.xz
Essentials-0a17489c9c16d32a8d8fd4a72e0bb4ffa48991a2.zip
Clarify kit errors
-rw-r--r--Essentials/src/com/earth2me/essentials/Kit.java8
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkit.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/signs/SignKit.java2
-rw-r--r--EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java2
4 files changed, 8 insertions, 8 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Kit.java b/Essentials/src/com/earth2me/essentials/Kit.java
index 1b71eefb5..7291594c5 100644
--- a/Essentials/src/com/earth2me/essentials/Kit.java
+++ b/Essentials/src/com/earth2me/essentials/Kit.java
@@ -133,7 +133,7 @@ public class Kit
}
}
- public static List<String> getItems(final IEssentials ess, final User user, final Map<String, Object> kit) throws Exception
+ public static List<String> getItems(final IEssentials ess, final User user, final String kitName, final Map<String, Object> kit) throws Exception
{
if (kit == null)
{
@@ -152,15 +152,15 @@ public class Kit
itemList.add(item.toString());
continue;
}
- throw new Exception("Error parsing kit item: " + item.toString());
+ throw new Exception("Invalid kit item: " + item.toString());
}
return itemList;
}
- throw new Exception("Error parsing kit: " + kitItems.toString());
+ throw new Exception("Invalid item list");
}
catch (Exception e)
{
- ess.getLogger().log(Level.WARNING, e.getMessage());
+ ess.getLogger().log(Level.WARNING, "Error parsing kit " + kitName + ": " + e.getMessage());
throw new Exception(_("kitError2"), e);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
index c3983b835..ccc58c224 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkit.java
@@ -56,7 +56,7 @@ public class Commandkit extends EssentialsCommand
final String kitName = args[0].toLowerCase(Locale.ENGLISH);
final Map<String, Object> kit = ess.getSettings().getKit(kitName);
- final List<String> items = Kit.getItems(ess, userTo, kit);
+ final List<String> items = Kit.getItems(ess, userTo, kitName, kit);
Kit.expandItems(ess, userTo, items);
sender.sendMessage(_("kitGiveTo", kitName, userTo.getDisplayName()));
@@ -78,7 +78,7 @@ public class Commandkit extends EssentialsCommand
throw new Exception(_("noKitPermission", "essentials.kits." + kitName));
}
- final List<String> items = Kit.getItems(ess, userTo, kit);
+ final List<String> items = Kit.getItems(ess, userTo, kitName, kit);
Kit.checkTime(userFrom, kitName, kit);
diff --git a/Essentials/src/com/earth2me/essentials/signs/SignKit.java b/Essentials/src/com/earth2me/essentials/signs/SignKit.java
index b11125e5b..a2964d7f2 100644
--- a/Essentials/src/com/earth2me/essentials/signs/SignKit.java
+++ b/Essentials/src/com/earth2me/essentials/signs/SignKit.java
@@ -61,7 +61,7 @@ public class SignKit extends EssentialsSign
{
final Map<String, Object> kit = ess.getSettings().getKit(kitName);
Kit.checkTime(player, kitName, kit);
- final List<String> items = Kit.getItems(ess, player, kit);
+ final List<String> items = Kit.getItems(ess, player, kitName, kit);
Kit.expandItems(ess, player, items);
charge.charge(player);
Trade.log("Sign", "Kit", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess);
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
index 8b645fa58..6fcabe6e0 100644
--- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
+++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java
@@ -123,7 +123,7 @@ public class EssentialsSpawnPlayerListener implements Listener
try
{
final Map<String, Object> kit = ess.getSettings().getKit(kitName.toLowerCase(Locale.ENGLISH));
- final List<String> items = Kit.getItems(ess, user, kit);
+ final List<String> items = Kit.getItems(ess, user, kitName, kit);
Kit.expandItems(ess, user, items);
}
catch (Exception ex)