Skip to content

Commit

Permalink
Fix non-op player command permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
fliplus committed Sep 8, 2024
1 parent 15183f3 commit eb645c4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
context.getSource().sendSuccess(() -> Component.literal(message).withStyle(ChatFormatting.ITALIC, ChatFormatting.GRAY), false);

return 0;
}).requires(source -> source.hasPermission(2)).then(Commands.literal("reload").executes(context -> {
}).then(Commands.literal("reload").requires(source -> source.hasPermission(2)).executes(context -> {
ServerPlayer player = context.getSource().getPlayer();
assert player != null;

SimplePlayerListConfig.INSTANCE.load(context.getSource());

return 0;
})).then(Commands.literal("toggle").executes(context -> {
})).then(Commands.literal("toggle").requires(source -> source.hasPermission(2)).executes(context -> {
MinecraftServer server = context.getSource().getServer();
ServerPlayer player = context.getSource().getPlayer();
assert player != null;
Expand Down

0 comments on commit eb645c4

Please sign in to comment.