This commit is contained in:
LexManos committed 2024-08-08 13:40:50 -07:00
1 parent 0ca1d0ebd0
commit db4d8a4729
8 files changed
+30 -28

No files matched your search

@@ -42,6 +42,7 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import net.minecraft.commands.SharedSuggestionProvider;
import net.minecraft.commands.arguments.selector.EntitySelectorParser;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
@@ -1003,7 +1004,7 @@ public final class ForgeHooks {
}
public static boolean canUseEntitySelectors(SharedSuggestionProvider provider) {
if (provider.hasPermission(Commands.LEVEL_GAMEMASTERS))
if (EntitySelectorParser.allowSelectors(provider))
return true;
else if (provider instanceof CommandSourceStack source && source.source instanceof ServerPlayer player)
return PermissionAPI.getPermission(player, ForgeMod.USE_SELECTORS_PERMISSION);