Better logging when Appliance command errors occur

This commit is contained in:
Elias Müller 2023-10-25 00:32:44 +02:00
parent 8ef3164eae
commit 160a17ea62

@ -3,6 +3,7 @@ package eu.mhsl.craftattack.spawn.appliance;
import eu.mhsl.craftattack.spawn.Main;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@ -35,6 +36,8 @@ public abstract class ApplianceCommand<T extends Appliance> implements Appliance
execute(sender, command, label, args);
} catch (Exception e) {
sender.sendMessage(errorMessage);
Bukkit.getLogger().warning("Error executing appliance command " + commandName + " with " + e.getMessage());
e.printStackTrace(System.err);
return false;
}
return true;