2019-10-08 03:50:10 +02:00
|
|
|
package com.songoda.epicbosses.commands;
|
2018-10-09 15:23:40 +02:00
|
|
|
|
2019-10-08 03:50:10 +02:00
|
|
|
import com.songoda.core.commands.AbstractCommand;
|
2018-10-26 06:44:07 +02:00
|
|
|
import com.songoda.epicbosses.managers.DebugManager;
|
|
|
|
import com.songoda.epicbosses.utils.Message;
|
2018-10-09 15:23:40 +02:00
|
|
|
import org.bukkit.command.CommandSender;
|
2018-10-09 16:32:35 +02:00
|
|
|
import org.bukkit.entity.Player;
|
2018-10-09 15:23:40 +02:00
|
|
|
|
2019-10-08 03:50:10 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
2018-10-09 15:23:40 +02:00
|
|
|
/**
|
|
|
|
* @author Charles Cullen
|
|
|
|
* @version 1.0.0
|
|
|
|
* @since 09-Oct-18
|
|
|
|
*/
|
2019-10-08 03:50:10 +02:00
|
|
|
public class CommandDebug extends AbstractCommand {
|
2018-10-09 15:23:40 +02:00
|
|
|
|
2018-10-09 16:32:35 +02:00
|
|
|
private DebugManager debugManager;
|
2018-10-09 15:23:40 +02:00
|
|
|
|
2019-10-08 03:50:10 +02:00
|
|
|
public CommandDebug(DebugManager debugManager) {
|
|
|
|
super(true, "debug");
|
2018-10-09 16:32:35 +02:00
|
|
|
this.debugManager = debugManager;
|
2018-10-09 15:23:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-10-08 03:50:10 +02:00
|
|
|
protected ReturnType runCommand(CommandSender sender, String... args) {
|
2018-10-09 16:32:35 +02:00
|
|
|
Player player = (Player) sender;
|
|
|
|
String toggled;
|
|
|
|
|
2019-10-07 23:25:54 +02:00
|
|
|
if (this.debugManager.isToggled(player.getUniqueId())) {
|
2018-10-09 16:32:35 +02:00
|
|
|
this.debugManager.togglePlayerOff(player.getUniqueId());
|
|
|
|
toggled = "Off";
|
|
|
|
} else {
|
|
|
|
this.debugManager.togglePlayerOn(player.getUniqueId());
|
|
|
|
toggled = "On";
|
|
|
|
}
|
|
|
|
|
|
|
|
Message.Boss_Debug_Toggled.msg(player, toggled);
|
2019-10-08 03:50:10 +02:00
|
|
|
return ReturnType.SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected List<String> onTab(CommandSender commandSender, String... args) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getPermissionNode() {
|
2020-03-19 17:32:26 +01:00
|
|
|
return "boss.debug";
|
2019-10-08 03:50:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getSyntax() {
|
2020-03-19 17:32:26 +01:00
|
|
|
return "debug";
|
2019-10-08 03:50:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getDescription() {
|
2020-03-19 17:32:26 +01:00
|
|
|
return "Toggles on and off the debug mode.";
|
2018-10-09 15:23:40 +02:00
|
|
|
}
|
|
|
|
}
|