From a6e32e08cfd3ff3198875f205a0751273b97db5a Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 10 Apr 2021 18:40:11 +0200 Subject: [PATCH] Simplify CommandProtect --- .../steamwar/bausystem/commands/CommandProtect.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java index 249d512..1ac7468 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandProtect.java @@ -114,14 +114,11 @@ public class CommandProtect extends SWCommand implements Listener { @EventHandler public void onExplode(EntityExplodeEvent event) { + Region region = Region.getRegion(event.getLocation()); + if (!region.isProtect() && !region.hasProtection()) { + return; + } event.blockList().removeIf(block -> { - Region region = Region.getRegion(block.getLocation()); - if (!region.isProtect()) { - return false; - } - if (!region.hasProtection()) { - return false; - } return block.getY() < region.getProtectYLevel(); }); }