endercrest / VoidSpawn

A Spigot & Bukkit plugin that teleports players upon entering the void.
https://www.spigotmc.org/resources/voidspawn.19350/
GNU Lesser General Public License v2.1
5 stars 10 forks source link

OP: does not apply to multiple commands #68

Closed SlimeDog closed 4 years ago

SlimeDog commented 4 years ago

Describe the bug op: applies only to the first command in a multiple-command invocation. For example:

command: op:stats ${player.name} DEATHS ++1 ; mvtp ${player.name} e:world_void:0.5,64,0.1:0:0

fails if the player does not have mvtp permissions, because op: applies only to the first (stats) command. But:

command: op:stats ${player.name} DEATHS ++1 ; op:mvtp ${player.name} e:world_void:0.5,64,0.1:0:0

fails as an illegal command.

VoidSpawn Version: 1.18.3 Spigot Version: 1.15.2 (Jenkins 2686)

SlimeDog commented 4 years ago

Please consider alternative, standard YAML, syntax. For example (based on the above)

  command:
  - op:stats ${player.name} DEATHS ++1
  - op:mvtp ${player.name} e:world_void:0.5,64,0.1:0:0
SlimeDog commented 4 years ago

Please test for more than two commands. Some of my nodes have three commands.

endercrest commented 4 years ago

I will try to find some time for this today. I quickly scanned through the code and I couldn't see a logic error. So will need to look into this further.

SlimeDog commented 4 years ago

Thanks. I'm pretty confident. If a player has op permissions (or the required permissions), all commands are executed. Otherwise, only the first (op:) command is executed.

endercrest commented 4 years ago

I found the problem. Looks like it is the space wrapping around the semi-colon that is causing the problem. This should work with the current version:

op:stats ${player.name} DEATHS ++1;op:mvtp ${player.name} e:world_void:0.5,64,0.1:0:0

I will put together a patch though so this doesn't cause a problem.

endercrest commented 4 years ago

Closing this off as fixed, will be available with the next version.