From f9dd270bae33af93ed2ffbb7f128db31a7d8a8b9 Mon Sep 17 00:00:00 2001 From: glorydark <1083215364@qq.com> Date: Sat, 6 Apr 2024 05:43:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E4=BC=A0?= =?UTF-8?q?=E9=80=81=E5=88=B0=E5=85=B6=E4=BB=96=E4=B8=96=E7=95=8C=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glorydark/DLevelEventPlus/api/PermissionAPI.java | 3 ++- .../DLevelEventPlus/event/EntityEventListener.java | 10 +++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/glorydark/DLevelEventPlus/api/PermissionAPI.java b/src/main/java/glorydark/DLevelEventPlus/api/PermissionAPI.java index e698740..5b9beee 100644 --- a/src/main/java/glorydark/DLevelEventPlus/api/PermissionAPI.java +++ b/src/main/java/glorydark/DLevelEventPlus/api/PermissionAPI.java @@ -185,7 +185,8 @@ public static boolean isWhiteListed(Player p, Level level) { if (p == null) { return false; } - return new ArrayList<>(whitelists.getStringList(level.getName())).contains(p.getName()); + List list = new ArrayList<>(whitelists.getStringList(level.getName())); + return list.size() == 0 || list.contains(p.getName()); } public enum OperatePermissionType{ diff --git a/src/main/java/glorydark/DLevelEventPlus/event/EntityEventListener.java b/src/main/java/glorydark/DLevelEventPlus/event/EntityEventListener.java index f729400..c746054 100644 --- a/src/main/java/glorydark/DLevelEventPlus/event/EntityEventListener.java +++ b/src/main/java/glorydark/DLevelEventPlus/event/EntityEventListener.java @@ -137,13 +137,9 @@ public void EntityPortalEnterEvent(EntityPortalEnterEvent event) { if (PermissionAPI.isOperator(p, p.getLevel())) { return; } - if (!bool) { - event.setCancelled(true); - } - } else { - if (!bool) { - event.setCancelled(true); - } + } + if (!bool) { + event.setCancelled(true); } }