[DEV] New Cloth Config GUIs, new nojang apis, and bug fixes

This commit is contained in:
2025-01-14 17:14:57 +02:00
parent 864baeb6c5
commit 8a46899769
290 changed files with 6213 additions and 459 deletions

View File

@@ -1,5 +1,6 @@
package com.hypherionmc.craterlib.api.commands;
import com.hypherionmc.craterlib.CraterConstants;
import com.hypherionmc.craterlib.compat.LuckPermsCompat;
import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
import com.hypherionmc.craterlib.nojang.authlib.BridgedGameProfile;
@@ -137,10 +138,15 @@ public class CraterCommand {
}
private boolean checkPermission(CommandSourceStack stack) {
if (!ModloaderEnvironment.INSTANCE.isModLoaded("luckperms") || !stack.isPlayer() || luckPermNode.isEmpty())
return stack.hasPermission(this.permLevel);
try {
if (!ModloaderEnvironment.INSTANCE.isModLoaded("luckperms") || !stack.isPlayer() || luckPermNode.isEmpty())
return stack.hasPermission(this.permLevel);
return LuckPermsCompat.INSTANCE.hasPermission(stack.getPlayer(), this.luckPermNode) || stack.hasPermission(this.permLevel);
return LuckPermsCompat.INSTANCE.hasPermission(stack.getPlayer(), this.luckPermNode) || stack.hasPermission(this.permLevel);
} catch (Exception e) {
CraterConstants.LOG.error("Failed to check luckperms permissions", e);
return stack.hasPermission(this.permLevel);
}
}
@FunctionalInterface

View File

@@ -2,6 +2,7 @@ package com.hypherionmc.craterlib.api.events.compat;
import com.hypherionmc.craterlib.core.event.CraterEvent;
import com.hypherionmc.craterlib.nojang.authlib.BridgedGameProfile;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import java.util.UUID;
@@ -9,6 +10,7 @@ import java.util.UUID;
public class LuckPermsCompatEvents {
@RequiredArgsConstructor(staticName = "of")
@Getter
public static class GroupAddedEvent extends CraterEvent {
private final String identifier;
private final UUID uuid;
@@ -20,6 +22,7 @@ public class LuckPermsCompatEvents {
}
@RequiredArgsConstructor(staticName = "of")
@Getter
public static class GroupRemovedEvent extends CraterEvent {
private final String identifier;
private final UUID uuid;