mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 05:02:18 +00:00
This allows greater flexibility for configuring servers with operator-like permissions to user groups through the permissions API and their permissions handler of choice without needing to grant the vanilla operator permission to any player. The new permission is "forge:use_entity_selectors", which is granted by default to players with permission level 2 (GAMEMASTERS) and above. The hook falls back to checking the permission level if the source of the command is not a ServerPlayer, such as for command blocks and functions.
12 lines
721 B
Diff
12 lines
721 B
Diff
--- a/net/minecraft/commands/arguments/EntityArgument.java
|
|
+++ b/net/minecraft/commands/arguments/EntityArgument.java
|
|
@@ -115,7 +_,7 @@
|
|
if (s instanceof SharedSuggestionProvider sharedsuggestionprovider) {
|
|
StringReader stringreader = new StringReader(p_91483_.getInput());
|
|
stringreader.setCursor(p_91483_.getStart());
|
|
- EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, sharedsuggestionprovider.m_6761_(2));
|
|
+ EntitySelectorParser entityselectorparser = new EntitySelectorParser(stringreader, net.minecraftforge.common.ForgeHooks.canUseEntitySelectors(sharedsuggestionprovider));
|
|
|
|
try {
|
|
entityselectorparser.m_121377_();
|