DevLeoko / AdvancedBan

AdvancedBan is a Spigot plugin to manage punishments on single servers and server networks
GNU General Public License v3.0
162 stars 131 forks source link

Mute dont work. #601

Open Energobro opened 1 year ago

Energobro commented 1 year ago

_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

Hopefuls commented 1 year ago

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?

Energobro commented 1 year ago

Works without chat formatting But I want to mute with formatting

Hopefuls commented 1 year ago

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.

Energobro commented 1 year ago

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

Energobro commented 1 year ago

How can I fix this problem for myself?

Hopefuls commented 1 year ago

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.

Energobro commented 1 year ago

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

Hopefuls commented 1 year ago

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 commented 1 year ago

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 .

Energobro commented 1 year ago

In that discord figs who will help you