Skip to content

Commit

Permalink
Merge pull request GrimAnticheat#1113 from alec-jensen/2.0
Browse files Browse the repository at this point in the history
Fix /grim stopspectate
  • Loading branch information
AoElite authored Aug 14, 2023
2 parents 1832f32 + d1f0b48 commit ab2a7e8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ac.grim.grimac.utils.anticheat.MessageUtil;
import co.aikar.commands.BaseCommand;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandCompletion;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Subcommand;
import org.bukkit.command.CommandSender;
Expand All @@ -13,7 +14,9 @@
public class GrimStopSpectating extends BaseCommand {
@Subcommand("stopspectating")
@CommandPermission("grim.spectate")
public void onStopSpectate(CommandSender sender, String string) {
@CommandCompletion("here")
public void onStopSpectate(CommandSender sender, String[] args) {
String string = args.length > 0 ? args[0] : null;
if (!(sender instanceof Player)) return;
Player player = (Player) sender;
if (GrimAPI.INSTANCE.getSpectateManager().isSpectating(player.getUniqueId())) {
Expand All @@ -25,3 +28,4 @@ public void onStopSpectate(CommandSender sender, String string) {
}
}
}

0 comments on commit ab2a7e8

Please sign in to comment.