|
7 | 7 | import com.mojang.brigadier.exceptions.CommandSyntaxException; |
8 | 8 | import com.mojang.brigadier.exceptions.DynamicCommandExceptionType; |
9 | 9 | import net.minecraft.commands.CommandSourceStack; |
| 10 | +import net.minecraft.commands.Commands; |
10 | 11 | import net.minecraft.network.chat.ClickEvent; |
11 | 12 | import net.minecraft.network.chat.Component; |
12 | 13 | import net.minecraft.network.chat.Style; |
@@ -37,17 +38,17 @@ static void register(CommandDispatcher<CommandSourceStack> dispatcher) { |
37 | 38 | dispatcher.register( |
38 | 39 | literal("rmc") |
39 | 40 | .then(literal("schedule") |
40 | | - .requires(p -> p.hasPermission(3)) |
| 41 | + .requires(Commands.hasPermission(Commands.LEVEL_ADMINS)) |
41 | 42 | .executes(RMCCommand::scheduleBackup)) |
42 | 43 | .then(literal("setInterval") |
43 | | - .requires(p -> p.hasPermission(3)) |
| 44 | + .requires(Commands.hasPermission(Commands.LEVEL_ADMINS)) |
44 | 45 | .then(argument("interval", StringArgumentType.string()) |
45 | 46 | .executes(RMCCommand::setInterval))) |
46 | 47 | .then(literal("snapshots") |
47 | | - .requires(p -> p.hasPermission(3)) |
| 48 | + .requires(Commands.hasPermission(Commands.LEVEL_ADMINS)) |
48 | 49 | .executes(RMCCommand::listSnapshots)) |
49 | 50 | .then(literal("restore") |
50 | | - .requires(p -> p.hasPermission(4)) |
| 51 | + .requires(Commands.hasPermission(Commands.LEVEL_ADMINS)) |
51 | 52 | .then(argument("snapshot", StringArgumentType.string()) |
52 | 53 | .executes(RMCCommand::restore))) |
53 | 54 | .then(literal("version") |
|
0 commit comments