mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-08-21 13:51:22 +02:00
Update Fabric dependencies
This commit is contained in:
@@ -28,7 +28,7 @@ dependencies {
|
|||||||
modImplementation(fabricApi.module(it, '0.91.2+1.20.4'))
|
modImplementation(fabricApi.module(it, '0.91.2+1.20.4'))
|
||||||
}
|
}
|
||||||
|
|
||||||
include(modImplementation('me.lucko:fabric-permissions-api:0.2-SNAPSHOT'))
|
include(modImplementation('me.lucko:fabric-permissions-api:0.3.1'))
|
||||||
|
|
||||||
implementation project(':common')
|
implementation project(':common')
|
||||||
}
|
}
|
||||||
|
@@ -25,11 +25,13 @@
|
|||||||
|
|
||||||
package me.lucko.luckperms.fabric.listeners;
|
package me.lucko.luckperms.fabric.listeners;
|
||||||
|
|
||||||
|
import me.lucko.fabric.api.permissions.v0.OfflineOptionRequestEvent;
|
||||||
import me.lucko.fabric.api.permissions.v0.OfflinePermissionCheckEvent;
|
import me.lucko.fabric.api.permissions.v0.OfflinePermissionCheckEvent;
|
||||||
import me.lucko.fabric.api.permissions.v0.OptionRequestEvent;
|
import me.lucko.fabric.api.permissions.v0.OptionRequestEvent;
|
||||||
import me.lucko.fabric.api.permissions.v0.PermissionCheckEvent;
|
import me.lucko.fabric.api.permissions.v0.PermissionCheckEvent;
|
||||||
import me.lucko.luckperms.common.cacheddata.result.StringResult;
|
import me.lucko.luckperms.common.cacheddata.result.StringResult;
|
||||||
import me.lucko.luckperms.common.cacheddata.result.TristateResult;
|
import me.lucko.luckperms.common.cacheddata.result.TristateResult;
|
||||||
|
import me.lucko.luckperms.common.cacheddata.type.MonitoredMetaCache;
|
||||||
import me.lucko.luckperms.common.cacheddata.type.PermissionCache;
|
import me.lucko.luckperms.common.cacheddata.type.PermissionCache;
|
||||||
import me.lucko.luckperms.common.model.User;
|
import me.lucko.luckperms.common.model.User;
|
||||||
import me.lucko.luckperms.common.query.QueryOptionsImpl;
|
import me.lucko.luckperms.common.query.QueryOptionsImpl;
|
||||||
@@ -63,6 +65,7 @@ public class FabricPermissionsApiListener {
|
|||||||
PermissionCheckEvent.EVENT.register(this::onPermissionCheck);
|
PermissionCheckEvent.EVENT.register(this::onPermissionCheck);
|
||||||
OptionRequestEvent.EVENT.register(this::onOptionRequest);
|
OptionRequestEvent.EVENT.register(this::onOptionRequest);
|
||||||
OfflinePermissionCheckEvent.EVENT.register(this::onOfflinePermissionCheck);
|
OfflinePermissionCheckEvent.EVENT.register(this::onOfflinePermissionCheck);
|
||||||
|
OfflineOptionRequestEvent.EVENT.register(this::onOfflineOptionRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
private @NonNull TriState onPermissionCheck(CommandSource source, String permission) {
|
private @NonNull TriState onPermissionCheck(CommandSource source, String permission) {
|
||||||
@@ -92,6 +95,13 @@ public class FabricPermissionsApiListener {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private @NonNull CompletableFuture<Optional<String>> onOfflineOptionRequest(UUID uuid, String key) {
|
||||||
|
return lookupUser(uuid).thenApplyAsync(user -> {
|
||||||
|
MonitoredMetaCache metaData = user.getCachedData().getMetaData();
|
||||||
|
return Optional.ofNullable(metaData.getMetaOrChatMetaValue(key, CheckOrigin.PLATFORM_API));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public CompletableFuture<User> lookupUser(UUID uuid) {
|
public CompletableFuture<User> lookupUser(UUID uuid) {
|
||||||
User user = this.plugin.getUserManager().getIfLoaded(uuid);
|
User user = this.plugin.getUserManager().getIfLoaded(uuid);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
"fabric-command-api-v2": "*",
|
"fabric-command-api-v2": "*",
|
||||||
"fabric-lifecycle-events-v1": "*",
|
"fabric-lifecycle-events-v1": "*",
|
||||||
"fabric-networking-api-v1": "*",
|
"fabric-networking-api-v1": "*",
|
||||||
"fabric-permissions-api-v0": "*"
|
"fabric-permissions-api-v0": ">=0.3.1"
|
||||||
},
|
},
|
||||||
"custom": {
|
"custom": {
|
||||||
"modmenu:api": true
|
"modmenu:api": true
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
shadow = "8.1.1"
|
shadow = "8.1.1"
|
||||||
blossom = "1.3.1"
|
blossom = "1.3.1"
|
||||||
forgegradle = "[6.0,6.2)"
|
forgegradle = "[6.0,6.2)"
|
||||||
loom = "1.4-SNAPSHOT"
|
loom = "1.6-SNAPSHOT"
|
||||||
licenser = "0.6.1"
|
licenser = "0.6.1"
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
20
gradlew.bat
vendored
20
gradlew.bat
vendored
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("org.gradle.toolchains.foojay-resolver-convention") version("0.5.0")
|
id("org.gradle.toolchains.foojay-resolver-convention") version("0.8.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = 'luckperms'
|
rootProject.name = 'luckperms'
|
||||||
|
Reference in New Issue
Block a user