Fix incorrect inputQueue usage in some argument types
This commit is contained in:
parent
33c51967e2
commit
c26fbcb6fc
8 changed files with 13 additions and 7 deletions
|
|
@ -159,7 +159,6 @@ public final class OfflinePlayerArgument<C> extends CommandArgument<C, OfflinePl
|
|||
commandContext
|
||||
));
|
||||
}
|
||||
inputQueue.remove();
|
||||
|
||||
final OfflinePlayer player = Bukkit.getOfflinePlayer(input);
|
||||
|
||||
|
|
@ -167,6 +166,7 @@ public final class OfflinePlayerArgument<C> extends CommandArgument<C, OfflinePl
|
|||
return ArgumentParseResult.failure(new OfflinePlayerParseException(input, commandContext));
|
||||
}
|
||||
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(player);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@ public final class PlayerArgument<C> extends CommandArgument<C, Player> {
|
|||
commandContext
|
||||
));
|
||||
}
|
||||
inputQueue.remove();
|
||||
|
||||
Player player = Bukkit.getPlayer(input);
|
||||
|
||||
|
|
@ -159,6 +158,7 @@ public final class PlayerArgument<C> extends CommandArgument<C, Player> {
|
|||
return ArgumentParseResult.failure(new PlayerParseException(input, commandContext));
|
||||
}
|
||||
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(player);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,6 @@ public final class MultipleEntitySelectorArgument<C> extends CommandArgument<C,
|
|||
commandContext
|
||||
));
|
||||
}
|
||||
inputQueue.remove();
|
||||
|
||||
List<Entity> entities;
|
||||
try {
|
||||
|
|
@ -162,6 +161,7 @@ public final class MultipleEntitySelectorArgument<C> extends CommandArgument<C,
|
|||
));
|
||||
}
|
||||
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(new MultipleEntitySelector(input, entities));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,6 @@ public final class MultiplePlayerSelectorArgument<C> extends CommandArgument<C,
|
|||
commandContext
|
||||
));
|
||||
}
|
||||
inputQueue.remove();
|
||||
|
||||
if (!commandContext.get(BukkitCommandContextKeys.CLOUD_BUKKIT_CAPABILITIES).contains(
|
||||
CloudBukkitCapabilities.BRIGADIER)) {
|
||||
|
|
@ -154,6 +153,7 @@ public final class MultiplePlayerSelectorArgument<C> extends CommandArgument<C,
|
|||
if (player == null) {
|
||||
return ArgumentParseResult.failure(new PlayerArgument.PlayerParseException(input, commandContext));
|
||||
}
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(new MultiplePlayerSelector(input, ImmutableList.of(player)));
|
||||
}
|
||||
|
||||
|
|
@ -180,6 +180,7 @@ public final class MultiplePlayerSelectorArgument<C> extends CommandArgument<C,
|
|||
}
|
||||
}
|
||||
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(new MultiplePlayerSelector(input, entities));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -154,7 +154,6 @@ public final class SingleEntitySelectorArgument<C> extends CommandArgument<C, Si
|
|||
commandContext
|
||||
));
|
||||
}
|
||||
inputQueue.remove();
|
||||
|
||||
List<Entity> entities;
|
||||
try {
|
||||
|
|
@ -177,6 +176,7 @@ public final class SingleEntitySelectorArgument<C> extends CommandArgument<C, Si
|
|||
));
|
||||
}
|
||||
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(new SingleEntitySelector(input, entities));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,6 @@ public final class SinglePlayerSelectorArgument<C> extends CommandArgument<C, Si
|
|||
commandContext
|
||||
));
|
||||
}
|
||||
inputQueue.remove();
|
||||
|
||||
if (!commandContext.get(BukkitCommandContextKeys.CLOUD_BUKKIT_CAPABILITIES).contains(
|
||||
CloudBukkitCapabilities.BRIGADIER)) {
|
||||
|
|
@ -160,6 +159,7 @@ public final class SinglePlayerSelectorArgument<C> extends CommandArgument<C, Si
|
|||
if (player == null) {
|
||||
return ArgumentParseResult.failure(new PlayerArgument.PlayerParseException(input, commandContext));
|
||||
}
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(new SinglePlayerSelector(input, ImmutableList.of(player)));
|
||||
}
|
||||
|
||||
|
|
@ -194,6 +194,7 @@ public final class SinglePlayerSelectorArgument<C> extends CommandArgument<C, Si
|
|||
));
|
||||
}
|
||||
|
||||
inputQueue.remove();
|
||||
return ArgumentParseResult.success(new SinglePlayerSelector(input, entities));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue