Zrips / CMI

112 stars 98 forks source link

CMIUser.isVanished() issue #6322

Open MrMcyeet opened 2 years ago

MrMcyeet commented 2 years ago

Description of issue: The CMIUser.isVanished() method seems to have some issue

I wrote a whole thing about it HERE, Basically, I thought that another plugin was the root cause of an issue I was having with ChatControl, but it turns out that CMI was.

The gist of it is that it seems that CMIUser.isVanished() seems to return true when AdvancedLogin's option SpectatorOnLogin is set to true, even if CMI's vanish module is disabled, which was causing ChatControl's player join messages to not appear when a player joined.


Cmi Version (using/cmi version):

--------------------------------------------------
CMI: 9.0.6.0 SqLite-> 9.0.6.1
CMILib: 1.0.4.2
Server: Paper(356) 1.17.1-R0.1-SNAPSHOT
CMI economy: Disabled Vault: 1.7.3-b CMI Chat: Disabled
Modules -> 44 enabled 12 disabled: deathMessages, customMessages, mirror, tablist, firstJoinMessages, votifier, moneyCheque, spawnerCharge, vanish, namePlates, elytraLaunch, kits
--------------------------------------------------

Server Type (Spigot/Paperspigot/etc): PaperSpigot


Server Version (using /ver):

Paper version git-Paper-356 (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: 744dd8c)

Relevant plugins (Delete if this isn't needed):

Zrips commented 2 years ago

CMIUser.isVanished() will return true if player is not visible, this can be result of ether player having vanish mode enabled in CMI or player having "vanished" metadata attached to him which usually is a result of another vanish plugin, to create simple way to identify vanished player across multiple plugins without a need to have direct support. You can use #CMIUser.isCMIVanished() which only checks CMI vanish state and avoids checking meta data which might be better option for your case scenario.