Temporarily disable luckperms command integration on Paper

This commit is contained in:
2025-03-09 18:29:40 +02:00
parent fdbadd6696
commit 1a48fb6d33
13 changed files with 30 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
--- a/Common/src/main/java/com/hypherionmc/craterlib/api/commands/CraterCommand.java
+++ b/Common/src/main/java/com/hypherionmc/craterlib/api/commands/CraterCommand.java
@@ -15,6 +15,7 @@
@@ -16,6 +16,7 @@
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.commands.arguments.GameProfileArgument;
@@ -8,7 +8,7 @@
import net.minecraft.world.entity.player.Player;
import org.jetbrains.annotations.ApiStatus;
@@ -54,7 +55,7 @@
@@ -55,7 +56,7 @@
public CraterCommand withGameProfilesArgument(String key, CommandExecutorWithArgs<List<BridgedGameProfile>> executor) {
this.mojangCommand.then(Commands.argument(key, GameProfileArgument.gameProfile())
.executes(context -> executor.run(
@@ -17,7 +17,7 @@
GameProfileArgument.getGameProfiles(context, key).stream().map(BridgedGameProfile::of).toList(),
BridgedCommandSourceStack.of(context.getSource()))
));
@@ -64,7 +65,7 @@
@@ -65,7 +66,7 @@
public CraterCommand withBoolArgument(String key, CommandExecutorWithArgs<Boolean> executor) {
this.mojangCommand.then(Commands.argument(key, BoolArgumentType.bool())
.executes(context -> executor.run(
@@ -26,7 +26,7 @@
BoolArgumentType.getBool(context, key),
BridgedCommandSourceStack.of(context.getSource())
)));
@@ -74,7 +75,7 @@
@@ -75,7 +76,7 @@
public CraterCommand withWordArgument(String key, CommandExecutorWithArgs<String> executor) {
this.mojangCommand.then(Commands.argument(key, StringArgumentType.word())
.executes(context -> executor.run(
@@ -35,7 +35,7 @@
StringArgumentType.getString(context, key),
BridgedCommandSourceStack.of(context.getSource())
)));
@@ -84,7 +85,7 @@
@@ -85,7 +86,7 @@
public CraterCommand withStringArgument(String key, CommandExecutorWithArgs<String> executor) {
this.mojangCommand.then(Commands.argument(key, StringArgumentType.string())
.executes(context -> executor.run(
@@ -44,7 +44,7 @@
StringArgumentType.getString(context, key),
BridgedCommandSourceStack.of(context.getSource())
)));
@@ -94,7 +95,7 @@
@@ -95,7 +96,7 @@
public CraterCommand withPhraseArgument(String key, CommandExecutorWithArgs<String> executor) {
this.mojangCommand.then(Commands.argument(key, StringArgumentType.greedyString())
.executes(context -> executor.run(
@@ -53,7 +53,7 @@
StringArgumentType.getString(context, key),
BridgedCommandSourceStack.of(context.getSource())
)));
@@ -104,7 +105,7 @@
@@ -105,7 +106,7 @@
public CraterCommand withIntegerArgument(String key, CommandExecutorWithArgs<Integer> executor) {
this.mojangCommand.then(Commands.argument(key, IntegerArgumentType.integer())
.executes(context -> executor.run(
@@ -62,12 +62,12 @@
IntegerArgumentType.getInteger(context, key),
BridgedCommandSourceStack.of(context.getSource())
)));
@@ -139,14 +140,14 @@
@@ -140,14 +141,14 @@
private boolean checkPermission(CommandSourceStack stack) {
try {
- if (!ModloaderEnvironment.INSTANCE.isModLoaded("luckperms") || !stack.isPlayer() || luckPermNode.isEmpty())
+ if (!ModloaderEnvironment.INSTANCE.isModLoaded("luckperms") || !(stack.getEntity() instanceof Player) || luckPermNode.isEmpty())
- if (!ModloaderEnvironment.INSTANCE.isModLoaded("luckperms") || ModloaderEnvironment.INSTANCE.getLoaderType() == LoaderType.PAPER || !stack.isPlayer() || luckPermNode.isEmpty())
+ if (!ModloaderEnvironment.INSTANCE.isModLoaded("luckperms") || ModloaderEnvironment.INSTANCE.getLoaderType() == LoaderType.PAPER || !(stack.getEntity() instanceof Player) || luckPermNode.isEmpty())
return stack.hasPermission(this.permLevel);
- return LuckPermsCompat.INSTANCE.hasPermission(stack.getPlayer(), this.luckPermNode) || stack.hasPermission(this.permLevel);