Fix permission level to use the target selector

This commit is contained in:
themode 2021-01-09 02:20:55 +01:00
parent ac1fa4cb9e
commit a6e5dbc60e
3 changed files with 11 additions and 8 deletions

View File

@ -443,10 +443,9 @@ public final class CommandManager {
if (lastNodes != null) {
final int[] children = ArrayUtils.toArray(argChildren);
lastNodes.forEach(n ->
n.children = n.children == null ?
children :
ArrayUtils.concatenateIntArrays(n.children, children));
lastNodes.forEach(n -> n.children = n.children == null ?
children :
ArrayUtils.concatenateIntArrays(n.children, children));
}
nodes.add(node);

View File

@ -66,8 +66,6 @@ public class ArgumentEntities extends Argument<EntityFinder> {
@NotNull
@Override
public EntityFinder parse(@NotNull String input) throws ArgumentSyntaxException {
System.out.println("check: " + input);
// Check for raw player name
if (input.length() <= 16) {
if (CONNECTION_MANAGER.getPlayer(input) != null) {
@ -120,13 +118,13 @@ public class ArgumentEntities extends Argument<EntityFinder> {
// Remove brackets
final String structureData = structure.substring(1, structure.length() - 1);
System.out.println("structure data: " + structureData);
//System.out.println("structure data: " + structureData);
String currentArgument = "";
for (int i = 0; i < structureData.length(); i++) {
final char c = structureData.charAt(i);
if (c == '=') {
System.out.println("type: " + currentArgument);
//System.out.println("type: " + currentArgument);
if (!validArguments.contains(currentArgument))
throw new ArgumentSyntaxException("Argument name '" + currentArgument + "' does not exist", input, INVALID_ARGUMENT_NAME);

View File

@ -313,6 +313,12 @@ public class Player extends LivingEntity implements CommandSender {
}
// Tags end
// Permission
{
// Required to use the target selector argument
setPermissionLevel(2);
}
// Some client update
this.playerConnection.sendPacket(getPropertiesPacket()); // Send default properties
refreshHealth(); // Heal and send health packet