Files
Project-CrankedPvP/Staff/src/main/java/net/crankedpvp/staff/commands/StaffModeCommand.java
T
2026-10-12 13:57:05 -03:00

33 lines
1.0 KiB
Java

package net.crankedpvp.staff.commands;
import me.mattstudios.mf.annotations.Alias;
import me.mattstudios.mf.annotations.Command;
import me.mattstudios.mf.annotations.Default;
import me.mattstudios.mf.annotations.Permission;
import me.mattstudios.mf.base.CommandBase;
import net.crankedpvp.staff.StaffPlugin;
import net.crankedpvp.staff.struct.StaffMode;
import org.bukkit.entity.Player;
@Command("staff")
@Alias({"staffmode", "csm"})
public class StaffModeCommand extends CommandBase {
private StaffPlugin plugin;
public StaffModeCommand(StaffPlugin plugin) {
this.plugin = plugin;
}
@Default
@Permission("cranked.staff")
public void defaultCommand(Player player) {
if(this.plugin.getStaffManager().isPlayerInStaffMode(player)) {
StaffMode staffMode = this.plugin.getStaffManager().getStaffModeFromPlayer(player);
staffMode.removePlayerFromStaffMode();
return;
}
StaffMode staffMode = new StaffMode(player);
staffMode.putPlayerInStaffMode();
}
}