updated maintenance command feedback
This commit is contained in:
parent
fc5b76290e
commit
3abf5a95e8
@ -1,6 +1,8 @@
|
||||
package eu.mhsl.craftattack.spawn.appliances.maintenance;
|
||||
|
||||
import eu.mhsl.craftattack.spawn.appliance.ApplianceCommand;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -18,9 +20,14 @@ public class MaintenanceCommand extends ApplianceCommand<Maintenance> {
|
||||
|
||||
@Override
|
||||
protected void execute(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) throws Exception {
|
||||
if(args.length != 1 || !arguments.containsKey(args[0])) throw new Error("Argument 'enable' oder 'disable' gefordert!");
|
||||
getAppliance().setState(arguments.get(args[0]));
|
||||
sender.sendMessage(String.format("Maintanance: %b", getAppliance().isInMaintenance()));
|
||||
if(args.length == 1 && arguments.containsKey(args[0])) {
|
||||
getAppliance().setState(arguments.get(args[0]));
|
||||
sender.sendMessage(Component.text("Maintanance mode updated!", NamedTextColor.GREEN));
|
||||
}
|
||||
sender.sendMessage(Component.text(
|
||||
String.format("Maintanance mode is %b", getAppliance().isInMaintenance()),
|
||||
NamedTextColor.GOLD
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user