[BUG] `rp flag info` not working -- wrong handling of command arguments
EtaoinWu opened this issue ยท 2 comments
Describe the bug
It's impossible to use rp flag info <region> <world>
to obtain the flag status of a region.
To Reproduce
Steps to reproduce the behavior:
- Run a server, create a region in the overworld
- Run
rp flag info <name of region just created> world
in the server command - The plugin displays the help message instead of the flag info
Expected behavior
Should display as if a user inside the region typed /rp flag info
.
Server and plugins versions (please complete the following information):
- Server: Purpur 1.20.4 (git 2143)
- Plugin Version: 8.1.1-SNAPSHOT
- Java Version: Java 18
Additional context
First of all, amazing plugin! Thanks for the great work.
I browsed through the source code, and I believe the issue is in here:
if (args.length == 3 && /* some other conditions */ && args[2].equalsIgnoreCase("info")) {
if (Bukkit.getWorld(args[2]) != null) {
// ... send getFlagInfo()
}
}
This code requires args[2]
to be both info
and a world name, which is impossible. I guess this should be instead
if (args.length == 3 && /* some other conditions */ && args[0].equalsIgnoreCase("info")) {