EssentialsX

EssentialsX

2M Downloads

Logic behind "add-(prefix|suffix)-in-playerlist" is broken

Maxetto opened this issue ยท 3 comments

commented

Both setting "add-prefix-in-playerlist" and "add-suffix-in-playerlist" to true and false will always show the prefix and suffix (if any) in the playerlist.

This is caused by this:
if (withPrefix || !ess.getSettings().disablePrefix()) {
if (withSuffix || !ess.getSettings().disableSuffix()) {
This will always be true, because the second argument returns true (I want prefixes on chat, but not in playerlist).

EDIT: Potential Fix:
if (withPrefix && !ess.getSettings().disablePrefix()) {
if (withSuffix && !ess.getSettings().disableSuffix()) {

commented

Logic also seems broken with the suffix. Does this JAR exhibit the correct behavior? https://transfer.sh/vxExl/essentialsx-2.0.1.jar

commented

Yes, it's the same also with Suffix.
I have already tried and built what I said in the EDIT for both Prefix and Suffix and it's working great.

If i'm correct it would be true only if both the variables are true, which solves the issue.

Do you want me to send a PR?

commented

No need, credited you in this one

198d852