From 9958f09fcd002af9bf0633a5cd32f8b8dce1a488 Mon Sep 17 00:00:00 2001 From: youpaishidifu Date: Tue, 21 Jul 2026 19:44:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A2=86=E5=9C=B0=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E4=B8=A4=E4=B8=AA=E9=97=AE=E9=A2=98=EF=BC=9A1.?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E6=9D=83=E9=99=90=E4=BE=A6=E5=90=AC=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9C=AA=E6=8E=88=E6=9D=83=E7=8E=A9=E5=AE=B6=E6=B8=85?= =?UTF-8?q?=E5=87=BA=202.=E5=88=A0=E9=99=A4=E6=8F=90=E7=A4=BA=E5=8F=AA?= =?UTF-8?q?=E5=AF=B9=E6=93=8D=E4=BD=9C=E8=80=85=E6=9C=AC=E4=BA=BA=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/Sdf1_login/AreaProtection.java | 31 +++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/main/java/Sdf1_login/AreaProtection.java b/src/main/java/Sdf1_login/AreaProtection.java index 7ba9809..5da4aee 100644 --- a/src/main/java/Sdf1_login/AreaProtection.java +++ b/src/main/java/Sdf1_login/AreaProtection.java @@ -3229,6 +3229,18 @@ public class AreaProtection implements Listener { if (newArea != null) { AreaConfig ac = areas.get(newArea); if (ac != null) { + // ★ 未授权玩家检查:无任何权限级别则踢出 + if (getPermissionLevel(p, ac) == null) { + Location safeLoc = findSafeExitLocation(p.getLocation(), ac); + if (safeLoc != null) { + p.teleport(safeLoc); + p.sendMessage("§c§l[区域防护] §f你不具备此领地的权限,已被传送出去"); + } else { + p.teleport(p.getWorld().getSpawnLocation()); + p.sendMessage("§c§l[区域防护] §f你不具备此领地的权限"); + } + return; + } // ★ denyMove检查:支持per-player独立权限 if (getEffectiveDeny(p, ac, "denyMove")) { Location safeLoc = findSafeExitLocation(p.getLocation(), ac); @@ -3389,6 +3401,18 @@ public class AreaProtection implements Listener { AreaConfig newAc = areas.get(newArea); if (newAc != null) { + // ★ 未授权玩家检查:无任何权限级别则踢出 + if (getPermissionLevel(p, newAc) == null) { + Location safeLoc = findSafeExitLocation(event.getFrom(), newAc); + if (safeLoc != null) { + p.teleport(safeLoc); + p.sendMessage("§c§l[区域防护] §f你不具备此领地的权限,已被传送出去"); + } else { + p.teleport(p.getWorld().getSpawnLocation()); + p.sendMessage("§c§l[区域防护] §f你不具备此领地的权限"); + } + return; + } // ★ denyMove检查:支持per-player独立权限 if (getEffectiveDeny(p, newAc, "denyMove")) { Location safeLoc = findSafeExitLocation(event.getFrom(), newAc); @@ -7496,13 +7520,6 @@ public class AreaProtection implements Listener { if (online != null && online.isOnline()) { online.sendMessage("§a§l[防护] §f领地 §e" + finalAreaName + " §f等待期结束,已自动删除"); } - // 通知所有在线管理员 - for (Player admin : Bukkit.getOnlinePlayers()) { - if (admin.getUniqueId().equals(uid)) continue; - if (isAreaAdmin(admin)) { - admin.sendMessage("§7[防护] 领地 §e" + finalAreaName + " §7等待期结束,已自动删除"); - } - } } } }.runTaskLater(plugin, 1200L); // 60秒 = 1200 tick