- [FEAT] New APIs for Maintenance Mode and rewrite commands system

- [FEAT] Improved config system to fix old loading bugs and support JSON
- [FEAT] LuckPerms support for commands
This commit is contained in:
2024-08-10 14:13:51 +02:00
parent 2c13d507c3
commit 0dbf07de46
39 changed files with 729 additions and 237 deletions

View File

@@ -0,0 +1,20 @@
package com.hypherionmc.craterlib.compat;
import net.luckperms.api.LuckPerms;
import net.luckperms.api.LuckPermsProvider;
import net.luckperms.api.model.user.User;
import net.minecraft.server.level.ServerPlayer;
public class LuckPermsCompat {
public static final LuckPermsCompat INSTANCE = new LuckPermsCompat();
private final LuckPerms luckPerms = LuckPermsProvider.get();
LuckPermsCompat() {}
public boolean hasPermission(ServerPlayer player, String perm) {
User luckPermsUser = luckPerms.getPlayerAdapter(ServerPlayer.class).getUser(player);
return luckPermsUser.getCachedData().getPermissionData().checkPermission(perm).asBoolean();
}
}