mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-26 19:18:12 +01:00
Fix permission level to use the target selector
This commit is contained in:
parent
ac1fa4cb9e
commit
a6e5dbc60e
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user