Update Fabric dependencies

This commit is contained in:
Luck 2024-04-17 21:25:04 +01:00
parent 1dffd462a5
commit a43f4a11b0
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
7 changed files with 25 additions and 15 deletions

View File

@ -28,7 +28,7 @@ dependencies {
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')
}

View File

@ -25,11 +25,13 @@
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.OptionRequestEvent;
import me.lucko.fabric.api.permissions.v0.PermissionCheckEvent;
import me.lucko.luckperms.common.cacheddata.result.StringResult;
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.model.User;
import me.lucko.luckperms.common.query.QueryOptionsImpl;
@ -63,6 +65,7 @@ public class FabricPermissionsApiListener {
PermissionCheckEvent.EVENT.register(this::onPermissionCheck);
OptionRequestEvent.EVENT.register(this::onOptionRequest);
OfflinePermissionCheckEvent.EVENT.register(this::onOfflinePermissionCheck);
OfflineOptionRequestEvent.EVENT.register(this::onOfflineOptionRequest);
}
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) {
User user = this.plugin.getUserManager().getIfLoaded(uuid);
if (user != null) {

View File

@ -35,7 +35,7 @@
"fabric-command-api-v2": "*",
"fabric-lifecycle-events-v1": "*",
"fabric-networking-api-v1": "*",
"fabric-permissions-api-v0": "*"
"fabric-permissions-api-v0": ">=0.3.1"
},
"custom": {
"modmenu:api": true

View File

@ -2,7 +2,7 @@
shadow = "8.1.1"
blossom = "1.3.1"
forgegradle = "[6.0,6.2)"
loom = "1.4-SNAPSHOT"
loom = "1.6-SNAPSHOT"
licenser = "0.6.1"
[plugins]

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
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
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

20
gradlew.bat vendored
View File

@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail

View File

@ -13,7 +13,7 @@ pluginManagement {
}
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'