AdvancedBan icon indicating copy to clipboard operation
AdvancedBan copied to clipboard

Mute dont work.

Open Energobro opened this issue 2 years ago • 10 comments

_What version of AdvancedBan (/AdvancedBan) are you using? - last version

_What kind of server do you have (Bungeecord/single server)? single server

_What server version (/version) are you using? - 1.19.2 Purpur

Please provide the EXACT steps required to reproduce the problem...

  1. /mute nickname reason
  2. enter text in the chat

Any error/log post it through pastebin.com and link it here. (Also include /plugins/AdvancedBan/logs/latest.log) - no errors, log - 2023-01-09-1.log.gz

Add any additional information below. - Entered the command /mute The player's nickname and the reason, but he can still talk to the chat even though he is not an OP and does not have any rights. https://youtu.be/qX67OJyzGmE - youtube link with the problem

Energobro avatar Jan 09 '23 13:01 Energobro

Seems like you're using a chat formatting plugin that interferes with it. Could you try removing it and checking if it works without it?

Hopefuls avatar Jan 09 '23 13:01 Hopefuls

Works without chat formatting But I want to mute with formatting

Energobro avatar Jan 09 '23 13:01 Energobro

What plugin are you using to format the chat? If the plugin is still allowing you to chat then its related to the plugin and might be only something that can be fixed by that chat plugin owner.

Hopefuls avatar Jan 09 '23 13:01 Hopefuls

The owner of the chat is me. Using TextComponent on AsyncPlayerChatEvent

Energobro avatar Jan 09 '23 13:01 Energobro

How can I fix this problem for myself?

Energobro avatar Jan 09 '23 13:01 Energobro

Ensure that you're correctly re-formatting the message (using the setFormat Method or something like that, instead of just cancelling the event and sending it through a Broadcast for example), aswell as respecting the cancellation status of the event (refer to the spigot documentation regarding cancelled events).

AdvancedBan works on the highest priority as can be seen here on the bukkit-based chat listener. On this you're also able to see how AdvancedBan handles a mute status so you can adjust your plugin accordingly.

Hopefuls avatar Jan 09 '23 14:01 Hopefuls

On that link, everything is not very clear, what should I write to check if the player is muted?

Energobro avatar Jan 09 '23 14:01 Energobro

TL;DR: You are not respecting the cancellation status of the event is my guess, you can read more about it on the EventAPI documentation on SpigotMC.org.. I cannot provide support regarding your plugin.

Hopefuls avatar Jan 09 '23 14:01 Hopefuls

I realized that I need to cancel the action. if(Universal.get().getMethods().callChat(e.getPlayer())){ ?

Not cancel, you need to check if the event has been cancelled already. I have no clue how you're actually handling events, nor is this the right channel to ask that. You can ask in our discord server in the development channel and wait for someone who can help .

Hopefuls avatar Jan 09 '23 14:01 Hopefuls

In that discord figs who will help you

Energobro avatar Jan 09 '23 14:01 Energobro