fix: bungee unregister error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2020-02-14 04:02:37 +08:00
parent 1eefb729d7
commit 2ddd8c3879

View File

@ -96,8 +96,7 @@ export class BungeeEvent extends event.Event {
let prioritiesMap = this.byListenerAndPriority.get(eventCls); let prioritiesMap = this.byListenerAndPriority.get(eventCls);
if (prioritiesMap != null) { if (prioritiesMap != null) {
let bindings = reflect.on(listener).get("bindings").get(); let bindings = reflect.on(listener).get("bindings").get();
// Can't read hash map so need serialize and deserialize let priority = bindings["priority"];
let priority = JSON.parse(JSON.stringify(bindings))["priority"];
// Map<监听器, 方法[]> // Map<监听器, 方法[]>
let currentPriorityMap = prioritiesMap.get(priority); let currentPriorityMap = prioritiesMap.get(priority);
if (currentPriorityMap != null) { if (currentPriorityMap != null) {