From 399171f58ec14e69b07743a9d13137634ce7b304 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 24 May 2021 15:23:46 +0200 Subject: [PATCH] Update DepthCounterListener to count extension area as well Signed-off-by: yoyosource --- .../testblock/depthcounter/DepthCounterListener.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/depthcounter/DepthCounterListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/depthcounter/DepthCounterListener.java index 99778878..47f98554 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/depthcounter/DepthCounterListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/depthcounter/DepthCounterListener.java @@ -40,15 +40,12 @@ public class DepthCounterListener implements Listener { @EventHandler public void onEntityExplode(EntityExplodeEvent event) { Region region = Region.getRegion(event.getLocation()); - boolean testblock = event.blockList().stream().anyMatch(block -> region.inRegion(block.getLocation(), RegionType.TESTBLOCK, RegionExtensionType.NORMAL)); + boolean testblock = event.blockList().stream().anyMatch(block -> region.inRegion(block.getLocation(), RegionType.TESTBLOCK, RegionExtensionType.EXTENSION)); if (!testblock) { return; } - if (!DepthCounter.depthMap.containsKey(region)) { - DepthCounter.depthMap.put(region, new HashSet<>()); - } - + DepthCounter.depthMap.computeIfAbsent(region, r -> new HashSet<>()); Set depthSet = DepthCounter.depthMap.get(region); for (Depth depth : depthSet) { if (depth.update(event.blockList())) {