Add support for fabric-permissions-api

This commit is contained in:
NikitaCartes 2021-12-15 07:32:31 +03:00
parent 6186b16e8d
commit 68d5b9154d
6 changed files with 9 additions and 3 deletions

View File

@ -13,6 +13,7 @@ dependencies {
mappings "net.fabricmc:yarn:1.16.3+build.1:v2"
modImplementation "net.fabricmc:fabric-loader:0.9.3+build.207"
modImplementation "net.fabricmc.fabric-api:fabric-api:0.20.2+build.402-1.16"
modImplementation "me.lucko:fabric-permissions-api:0.1-SNAPSHOT"
shadowInclude (project(':BlueMapCommon')) {
//exclude dependencies provided by fabric

View File

@ -33,6 +33,7 @@
import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource;
import de.bluecolored.bluemap.common.plugin.text.Text;
import de.bluecolored.bluemap.core.world.World;
import me.lucko.fabric.api.permissions.v0.Permissions;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.Vec3d;
@ -56,7 +57,7 @@ public void sendMessage(Text text) {
@Override
public boolean hasPermission(String permission) {
return delegate.hasPermissionLevel(1);
return Permissions.check(delegate, permission, 1);
}
@Override

View File

@ -13,6 +13,7 @@ dependencies {
mappings "net.fabricmc:yarn:1.17+build.1:v2"
modImplementation "net.fabricmc:fabric-loader:0.11.3"
modImplementation "net.fabricmc.fabric-api:fabric-api:0.34.9+1.17"
modImplementation "me.lucko:fabric-permissions-api:0.1-SNAPSHOT"
shadowInclude (project(':BlueMapCommon')) {
//exclude dependencies provided by fabric

View File

@ -33,6 +33,7 @@
import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource;
import de.bluecolored.bluemap.common.plugin.text.Text;
import de.bluecolored.bluemap.core.world.World;
import me.lucko.fabric.api.permissions.v0.Permissions;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.Vec3d;
@ -56,7 +57,7 @@ public void sendMessage(Text text) {
@Override
public boolean hasPermission(String permission) {
return delegate.hasPermissionLevel(1);
return Permissions.check(delegate, permission, 1);
}
@Override

View File

@ -13,6 +13,7 @@ dependencies {
mappings "net.fabricmc:yarn:1.18-pre5+build.4:v2"
modImplementation "net.fabricmc:fabric-loader:0.11.3"
modImplementation "net.fabricmc.fabric-api:fabric-api:0.42.2+1.18"
modImplementation "me.lucko:fabric-permissions-api:0.1-SNAPSHOT"
shadowInclude (project(':BlueMapCommon')) {
//exclude dependencies provided by fabric

View File

@ -33,6 +33,7 @@
import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource;
import de.bluecolored.bluemap.common.plugin.text.Text;
import de.bluecolored.bluemap.core.world.World;
import me.lucko.fabric.api.permissions.v0.Permissions;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.Vec3d;
@ -56,7 +57,7 @@ public void sendMessage(Text text) {
@Override
public boolean hasPermission(String permission) {
return delegate.hasPermissionLevel(1);
return Permissions.check(delegate, permission, 1);
}
@Override