mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
1.21.1
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user