mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-23 19:16:37 +01:00
Update Fabric dependencies
This commit is contained in:
parent
1dffd462a5
commit
a43f4a11b0
@ -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')
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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]
|
||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -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
20
gradlew.bat
vendored
@ -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
|
||||
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user