Add some debugging to make it easier to diagnose kit errors.

This commit is contained in:
KHobbits 2014-06-25 19:19:04 +01:00
parent dbceccaa3e
commit 0f6625aea9

View File

@ -8,6 +8,7 @@ import com.earth2me.essentials.utils.StringUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.logging.Level;
import org.bukkit.Server;
@ -91,6 +92,11 @@ public class Commandkit extends EssentialsCommand
for (final Kit kit : kits)
{
try
{
kit.checkDelay(userFrom);
kit.checkAffordable(userFrom);
kit.setTime(userFrom);
kit.expandItems(userTo);
kit.chargeUser(userTo);
@ -101,6 +107,19 @@ public class Commandkit extends EssentialsCommand
}
userTo.sendMessage(tl("kitReceive", kit.getName()));
}
catch (NoChargeException ex)
{
if (ess.getSettings().isDebug())
{
ess.getLogger().log(Level.INFO, "Soft kit error, abort spawning " + kit.getName(), ex);
}
}
catch (Exception ex)
{
ess.showError(userFrom.getSource(), ex, "\\ kit: " + kit.getName());
}
}
}
}