Skip to content

Commit

Permalink
Merge pull request #65 from TheNextLvl-net/broadcast-fix
Browse files Browse the repository at this point in the history
Fix broadcast command permission check
  • Loading branch information
NonSwag authored Jan 3, 2025
2 parents e428f5a + 4b3b14d commit cceb47d
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import io.papermc.paper.command.brigadier.Commands;
import lombok.RequiredArgsConstructor;
import net.thenextlvl.tweaks.TweaksPlugin;
import org.bukkit.entity.Player;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

Expand All @@ -19,8 +18,7 @@ public class BroadcastCommand {

public void register(Commands registrar) {
var command = Commands.literal(plugin.commands().broadcast().command())
.requires(stack -> stack.getSender() instanceof Player player
&& player.hasPermission("tweaks.command.broadcast"))
.requires(stack -> stack.getSender().hasPermission("tweaks.command.broadcast"))
.then(Commands.argument("message", StringArgumentType.greedyString())
.executes(this::broadcast))
.build();
Expand Down

0 comments on commit cceb47d

Please sign in to comment.