EssentialsX

EssentialsX

2M Downloads

EssentialsX sends its own command syntax message for plugin-overridden commands

gladiusglad opened this issue ยท 2 comments

commented

Information

Full output of /ess version:

[13:52:20 INFO]: Server version: 1.16.4-R0.1-SNAPSHOT git-Paper-298 (MC: 1.16.4)
[13:52:20 INFO]: EssentialsX version: 2.18.2.0
[13:52:20 INFO]: PlaceholderAPI version: 2.10.9
[13:52:20 INFO]: LuckPerms version: 5.2.35
[13:52:20 INFO]: Vault version: 1.7.3-b131
[13:52:20 INFO]: Citizens version: 2.0.27-SNAPSHOT (build 2190)
[13:52:20 INFO]: EssentialsXSpawn version: 2.18.2.0

Server startup log:

https://gist.github.com/gladiusglad/4bc8b4d0db76e31dfffffa4044b0eec6

EssentialsX config:

https://gist.github.com/gladiusglad/21f57ceafd0ff157ded2046ec4e5a6ab

Details

Description:

When EssentialsX and another plugin, say, Plugin B, have the same commands, EssentialsX prioritizes Plugin B's over its own. This feature works just fine, the command is handled and tab completed by Plugin B perfectly.

However, when Plugin B's onCommand method returns false, EssentialsX still sends its own command usage message, as if the sender ran the EssX command with wrong syntax. This happens even when EssX's command is disabled in configs. This does not happen however if Plugin B's command is executed successfully, a.k.a returns true.

For example, /home is handled by Plugin B, but when the syntax is wrong according to Plugin B, it returns false and sends a syntax usage message to the sender. Yet EssentialsX assumes this false value comes from its own /home command and sends its own syntax message, /home [player:][name]. The result are two entirely different syntax usage messages from two plugins, which is jarring (see screenshot below).

In my case, Plugin B is a Homes plugin I wrote myself for personal uses. Since EssentialsX has its own home-related commands, these two conflict.

I think this is an accidental oversight on command prioritizing by the devs, so I labelled this as a bug. I haven't found any issues similar to this one, so I apologize if this is a duplicate. Thanks!

Steps to reproduce:

  1. Write a Homes plugin that returns false in onCommand when syntax is incorrect
  2. Use plugin along with EssentialsX in local test server
  3. Disable home-related commands in EssentialsX config.yml file under disabled-commands:
  4. Start server (Paper 1.16.4-323)
  5. Run /home with wrong syntax according to Homes plugin, for example /home m
  6. Get both Homes' and EssX's wrong syntax messages

Expected behavior:

For EssentialsX not to send its own command syntax message when a plugin that overrides its command returns false.

Console stack trace:

N/A

Screenshots:

image

commented

Confirmed on:

[12:34:16 INFO]: Server version: 1.16.4-R0.1-SNAPSHOT git-Paper-337 (MC: 1.16.4)
[12:34:16 INFO]: EssentialsX version: 2.19.0-dev+48-026d279
[12:34:16 INFO]: Vault version: 1.7.3-b131
commented

Fixed as of eae8bc0