print an error to console instead of blindly throwing an exception

This commit is contained in:
Pyrbu 2023-04-21 13:55:15 +01:00
parent ccb0e48ad1
commit e8ecc43ede

@ -38,7 +38,9 @@ public class DefaultCommand extends Command {
private static final SkinFunction DO_APPLY_SKIN = (sender, npc, skin) -> NPCSkin.forName(skin, (values, ex) -> {
if (ex != null) {
Configuration.MESSAGES.sendMessage(sender, ConfigurationValue.CANT_GET_SKIN, skin);
throw new RuntimeException(ex);
ZNPCsPlus.LOGGER.warning("Failed to fetch skin:");
ex.printStackTrace();
return;
}
npc.changeSkin(NPCSkin.forValues(values));
Configuration.MESSAGES.sendMessage(sender, ConfigurationValue.GET_SKIN);