Skip to content

Commit

Permalink
Add support for permission api, lower required op level
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Aug 8, 2023
1 parent cc34915 commit 2842bc2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ loader_version=0.14.21
fabric_version=0.83.0+1.20

# Mod Properties
mod_version=0.2.1
mod_version=0.2.2
maven_group=xyz.nucleoid
archives_base_name=nucleoid-creator-tools
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import me.lucko.fabric.api.permissions.v0.Permissions;
import net.minecraft.command.argument.BlockPosArgumentType;
import net.minecraft.command.argument.IdentifierArgumentType;
import net.minecraft.command.argument.NbtCompoundArgumentType;
Expand Down Expand Up @@ -62,7 +63,7 @@ public final class MapManageCommand {
// @formatter:off
public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
dispatcher.register(
literal("map").requires(source -> source.hasPermissionLevel(4))
literal("map").requires(Permissions.require("nucleoid_creator_extras.map", 2))
.then(literal("open")
.then(argument("workspace", IdentifierArgumentType.identifier())
.executes(context -> MapManageCommand.openWorkspace(context, null))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import com.mojang.brigadier.suggestion.SuggestionProvider;
import me.lucko.fabric.api.permissions.v0.Permissions;
import net.minecraft.command.CommandSource;
import net.minecraft.command.argument.BlockPosArgumentType;
import net.minecraft.command.argument.EntityArgumentType;
Expand Down Expand Up @@ -68,7 +69,7 @@ public final class MapMetadataCommand {
// @formatter:off
public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
dispatcher.register(
literal("map").requires(source -> source.hasPermissionLevel(4))
literal("map").requires(Permissions.require("nucleoid_creator_extras.map", 2))
.then(literal("region")
.then(literal("add")
.then(argument("marker", StringArgumentType.word())
Expand Down

0 comments on commit 2842bc2

Please sign in to comment.