• 欢迎来到Minecraft插件百科!
  • 对百科编辑一脸懵逼?帮助:快速入门带您快速熟悉百科编辑!
  • 因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289

“ChatControl Pro/WIKI/监听优先度”的版本间的差异

来自Minecraft插件百科
跳转至: 导航搜索
(创建页面,内容为“ 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…”)
 
第1行: 第1行:
 +
{{模板:Ccpbox}}
 +
大多数插件都会监听事件. 插件在其他插件取消事件后再次取消事件.所以优先度很重要.
  
 
+
按顺序排列共有六种优先度
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
 
# LOWEST
第12行: 第11行:
 
# MONITOR
 
# 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.
+
比如处理 BLOCK_PLACE 事件. lowest最低优先度监听器等待传唤是否取消事件. 然后low低优先度监听器会检查是否覆盖最低优先度的事件. 最后,它会发送到监视器,此时不改会事件的结果.<br>
 +
监视器用来查看事件的结果, 不会改变事件. 如果你安装了3个插件; 一个是基础的区域保护插件,一个是使用了告示牌的插件,最后一个是登录插件.保护插件监听Priority.LOWEST. 这款插件会发送 ''你无法在收保护的区域内放置方块' 的消息并取消放置方块的事件.<br>
 +
告示牌插件监听 Priority.NORMAL.发送 ''你无法在这里放置告示牌'' 并取消放置事件.<br>
 +
登录插件监听Priority.MONITOR. 登录插件会监听允许的事件并记录下来.
  
Source:
+
资源:
  
 
Event API 参考
 
Event API 参考
第22行: 第24行:
 
<br />
 
<br />
  
== 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.
+
关于ChatControl常见的疑问就是修改聊天处理顺序. 你可以在配置内手动修改优先度.
  
There are two priorities you can change. Both of them are found in the Listener_Priority section in settings.yml
+
你可以更改两种优先度. 位于settings.yml的Listener_Priority部分
  
# Listener_Priority.Formatter (Used for chat formatter and channels.)
+
# Listener_Priority.Formatter (用于聊天格式和频道.)
# Listener_Priority.Checker (Used for antispam, anticaps, rules etc.)
+
# Listener_Priority.Checker (用于防刷屏、防大写、规则等.)
# Listener_Priority.Signs (Used for rules on signs.)
+
# Listener_Priority.Signs (用于告示牌规则.)
  
 
<br />
 
<br />
  
 
=== Towny / Factions / Plots Squared ===
 
=== 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 <code>FactionsChat</code>:
+
对于大多数服务器, 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 <code>FactionsChat</code>:
 
  <code>Listener_Priority:
 
  <code>Listener_Priority:
 
   Formatter: LOWEST</code>
 
   Formatter: LOWEST</code>

2019年1月29日 (二) 14:52的版本

子页面

常见疑问

权限

指令

频道

JSON

分组

格式

Discord

获取帮助

变量

处理器

JavaScript变量

多世界聊天格式

自定义指令缩写

自定义服务器名

监听优先度

聊天忽略

本地化

大多数插件都会监听事件. 插件在其他插件取消事件后再次取消事件.所以优先度很重要.

按顺序排列共有六种优先度

  1. LOWEST
  2. LOW
  3. NORMAL
  4. HIGH
  5. HIGHEST
  6. MONITOR

比如处理 BLOCK_PLACE 事件. lowest最低优先度监听器等待传唤是否取消事件. 然后low低优先度监听器会检查是否覆盖最低优先度的事件. 最后,它会发送到监视器,此时不改会事件的结果.
监视器用来查看事件的结果, 不会改变事件. 如果你安装了3个插件; 一个是基础的区域保护插件,一个是使用了告示牌的插件,最后一个是登录插件.保护插件监听Priority.LOWEST. 这款插件会发送 你无法在收保护的区域内放置方块' 的消息并取消放置方块的事件.
告示牌插件监听 Priority.NORMAL.发送 你无法在这里放置告示牌 并取消放置事件.
登录插件监听Priority.MONITOR. 登录插件会监听允许的事件并记录下来.

资源:

Event API 参考

http://bukkit.gamepedia.com/Event_API_Reference#Event_Priorities


与其他插件的兼容问题及如何修复

关于ChatControl常见的疑问就是修改聊天处理顺序. 你可以在配置内手动修改优先度.

你可以更改两种优先度. 位于settings.yml的Listener_Priority部分

  1. Listener_Priority.Formatter (用于聊天格式和频道.)
  2. Listener_Priority.Checker (用于防刷屏、防大写、规则等.)
  3. Listener_Priority.Signs (用于告示牌规则.)


Towny / Factions / Plots Squared

对于大多数服务器, 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