mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-11 09:05:01 +02:00
Clarify kit errors
This commit is contained in:
@@ -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)
|
if (kit == null)
|
||||||
{
|
{
|
||||||
@@ -152,15 +152,15 @@ public class Kit
|
|||||||
itemList.add(item.toString());
|
itemList.add(item.toString());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
throw new Exception("Error parsing kit item: " + item.toString());
|
throw new Exception("Invalid kit item: " + item.toString());
|
||||||
}
|
}
|
||||||
return itemList;
|
return itemList;
|
||||||
}
|
}
|
||||||
throw new Exception("Error parsing kit: " + kitItems.toString());
|
throw new Exception("Invalid item list");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
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);
|
throw new Exception(_("kitError2"), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -56,7 +56,7 @@ public class Commandkit extends EssentialsCommand
|
|||||||
final String kitName = args[0].toLowerCase(Locale.ENGLISH);
|
final String kitName = args[0].toLowerCase(Locale.ENGLISH);
|
||||||
|
|
||||||
final Map<String, Object> kit = ess.getSettings().getKit(kitName);
|
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);
|
Kit.expandItems(ess, userTo, items);
|
||||||
|
|
||||||
sender.sendMessage(_("kitGiveTo", kitName, userTo.getDisplayName()));
|
sender.sendMessage(_("kitGiveTo", kitName, userTo.getDisplayName()));
|
||||||
@@ -78,7 +78,7 @@ public class Commandkit extends EssentialsCommand
|
|||||||
throw new Exception(_("noKitPermission", "essentials.kits." + kitName));
|
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);
|
Kit.checkTime(userFrom, kitName, kit);
|
||||||
|
|
||||||
|
@@ -61,7 +61,7 @@ public class SignKit extends EssentialsSign
|
|||||||
{
|
{
|
||||||
final Map<String, Object> kit = ess.getSettings().getKit(kitName);
|
final Map<String, Object> kit = ess.getSettings().getKit(kitName);
|
||||||
Kit.checkTime(player, kitName, kit);
|
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);
|
Kit.expandItems(ess, player, items);
|
||||||
charge.charge(player);
|
charge.charge(player);
|
||||||
Trade.log("Sign", "Kit", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess);
|
Trade.log("Sign", "Kit", "Interact", username, null, username, charge, sign.getBlock().getLocation(), ess);
|
||||||
|
@@ -123,7 +123,7 @@ public class EssentialsSpawnPlayerListener implements Listener
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
final Map<String, Object> kit = ess.getSettings().getKit(kitName.toLowerCase(Locale.ENGLISH));
|
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);
|
Kit.expandItems(ess, user, items);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
Reference in New Issue
Block a user