- 欢迎来到Minecraft插件百科!
- 对百科编辑一脸懵逼?帮助:快速入门带您快速熟悉百科编辑!
- 因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289
ChatControl Pro/WIKI/监听优先度
Every plugin gets a say in what happens, and every plugin must get a chance to know the outcome of an event. So, we pass events to plugins even after they've been cancelled. A plugin can actually uncancel an event after another plugin cancelled it. This is where priorities become really important.
There are six priorities in Bukkit that are called in the following order
- LOWEST
- LOW
- NORMAL
- HIGH
- HIGHEST
- MONITOR
Let's say a BLOCK_PLACE event is being handled. The lowest priority listener is called to get its say in whether it should be cancelled or not. Then the low priority listener is called to see if it wants to override the lowest, etc. Eventually it hits monitor, and at this point nothing should change the outcome of the event. Monitor should be used to see the outcome of an event, without changing any aspect of it. If we have three plugins enabled; one is a basic area protection plugin, one is a fancy plugin using signs, and another is a logging plugin. The protection plugin listens on Priority.LOWEST. It says they can't place blocks in this area, and cancels the event. The fancy sign plugin listens on Priority.NORMAL. It says they can place signs here, and uncancels the event. The log plugin listens on Priority.MONITOR. It sees that the event was actually allowed, and logs it.
Source:
Event API 参考
http://bukkit.gamepedia.com/Event_API_Reference#Event_Priorities
Issues With Other Plugins & How to Fix Them
Common issues involve that ChatControl modifies the chat before the other plugin, or after that, causing the wrong order. You can edit the priorities in ChatControl manually and find a suitable combination.
There are two priorities you can change. Both of them are found in the Listener_Priority section in settings.yml
- Listener_Priority.Formatter (Used for chat formatter and channels.)
- Listener_Priority.Checker (Used for antispam, anticaps, rules etc.)
- Listener_Priority.Signs (Used for rules on signs.)
Towny / Factions / Plots Squared
For the most servers, you will need to experiment with the values to find a suitable combination that works for you. One user has reported following configuration working well with FactionsChat
:
Listener_Priority:
Formatter: LOWEST
BanManager / Litebans
If players can speak even when muted, it means that ChatControl listens to the chat event before the plugin that mutes your players, and thus allow them to speak anyway.
Users have reported that changing the Formatter priority to HIGH have fixed the issue.
You may experiment with different values (LOWEST, LOW, NORMAL, HIGH, HIGHEST and also MONITOR) to find a combination that works with your other plugins.
Denizen
Use the following settings to allow the Citizens2-Addon Denizen to catch chat-triggers for its scripts.
Listener_Priority:
Formatter: HIGH