From fb871e886a8b4a6c3d0b16fb3a28ce606785420d Mon Sep 17 00:00:00 2001 From: youpaishidifu Date: Thu, 2 Jul 2026 19:35:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A2=86=E5=9C=B0=E6=8B=BE?= =?UTF-8?q?=E5=8F=96/=E4=B8=A2=E5=BC=83=E6=9D=83=E9=99=90=EF=BC=9AOWNER/Ad?= =?UTF-8?q?min=E4=B8=8D=E5=BA=94=E8=A2=ABallowDrop=3Dfalse=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E6=94=B9=E7=94=A8getEffectiveDeny=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/Sdf1_login/AreaProtection.java | 24 ++++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/main/java/Sdf1_login/AreaProtection.java b/src/main/java/Sdf1_login/AreaProtection.java index 5d70fbd..37168fe 100644 --- a/src/main/java/Sdf1_login/AreaProtection.java +++ b/src/main/java/Sdf1_login/AreaProtection.java @@ -2501,7 +2501,7 @@ public class AreaProtection implements Listener { case "denyFallDamage": return ac.denyFallDamage; case "denyHunger": return ac.denyHunger; case "denyAllDamage": return ac.denyAllDamage; - case "denyDrop": return ac.allowDrop; + case "denyDrop": return !ac.allowDrop; case "denyMount": return ac.denyMount; case "denyEnderPearl": return ac.denyEnderPearl; case "denyBow": return ac.denyBow; @@ -2511,7 +2511,7 @@ public class AreaProtection implements Listener { case "denyFireSpread": return ac.denyFireSpread; case "denyAllEffects": return ac.denyAllEffects; case "denyItemFrame": return ac.denyItemFrame; - case "denyPickup": return ac.allowPickup; + case "denyPickup": return !ac.allowPickup; case "denyFire": return ac.denyFire; case "denyThrownProjectiles": return ac.denyThrownProjectiles; case "denyGlowing": return ac.denyGlowing; @@ -4326,18 +4326,15 @@ public class AreaProtection implements Listener { p.getLocation().getBlockX(), p.getLocation().getBlockY(), p.getLocation().getBlockZ()); - if (ac != null && ac.allowDrop) { - // allowDrop=true 表示允许丢弃,不阻止 - return; - } - // allowDrop=false 或 no land → 默认不允许丢弃 - if (ac != null) { + if (ac == null) return; + // 使用getEffectiveDeny,OWNER/Admin自动豁免,visitor走领地默认 + if (getEffectiveDeny(p, ac, "denyDrop")) { e.setCancelled(true); p.sendMessage("§c§l[区域防护] §f禁止丢弃物品"); } } - // ★ 拾取限制:allowPickup=true时允许拾取,false时禁止拾取 + // ★ 拾取限制:allowPickup=false时禁止拾取(denyPickup映射到allowPickup) @EventHandler public void onPlayerPickup(PlayerPickupItemEvent e) { Player p = e.getPlayer(); @@ -4346,12 +4343,9 @@ public class AreaProtection implements Listener { p.getLocation().getBlockX(), p.getLocation().getBlockY(), p.getLocation().getBlockZ()); - if (ac != null && ac.allowPickup) { - // allowPickup=true 表示允许拾取,不阻止 - return; - } - // allowPickup=false 或 no land → 默认禁止拾取 - if (ac != null) { + if (ac == null) return; + // 使用getEffectiveDeny,OWNER/Admin自动豁免,visitor走领地默认 + if (getEffectiveDeny(p, ac, "denyPickup")) { e.setCancelled(true); // 节流:5~10秒随机间隔 long now = System.currentTimeMillis();