1
mirror of https://github.com/CarmJos/EasyListener.git synced 2024-09-19 13:25:51 +00:00

feat(event): 添加unregisterAll方法

添加unregisterAll方法便于快速注销单个
EasyListener实例中的全部监听器。

BREAKING CHANGE: 包名由 cc.carm.lib.easylisteners 变更为 cc.carm.lib.easylistener 。
This commit is contained in:
Carm Jos 2022-06-23 08:15:35 +08:00
parent ebfe697517
commit 4f7c93537c

View File

@ -287,6 +287,7 @@ public class EasyListener implements Listener {
});
}
@SuppressWarnings("deprecation")
public EasyListener cancelDeath(@Nullable Predicate<Player> predicate,
@Nullable Consumer<PlayerDeathEvent> handler) {
final Predicate<Player> p = Optional.ofNullable(predicate).orElse((player) -> true);