Update Region System of BauSystem

This commit is contained in:
2024-12-21 19:30:31 +01:00
parent 8427ae36f2
commit 6822dc796f
73 changed files with 927 additions and 1796 deletions
@@ -20,8 +20,6 @@
package de.steamwar.bausystem.features.testblock.blockcounter;
import de.steamwar.bausystem.region.Region;
import de.steamwar.bausystem.region.utils.RegionExtensionType;
import de.steamwar.bausystem.region.utils.RegionType;
import de.steamwar.linkage.Linked;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
@@ -37,11 +35,13 @@ public class BlockCounterListener implements Listener {
@EventHandler
public void onEntityExplode(EntityExplodeEvent event) {
Region region = Region.getRegion(event.getLocation());
if (region.isGlobal()) {
if (region.getType().isGlobal()) {
return;
}
List<Block> blockList = event.blockList();
blockList = blockList.stream().filter(block -> region.inRegion(block.getLocation(), RegionType.TESTBLOCK, RegionExtensionType.EXTENSION)).collect(Collectors.toList());
blockList = blockList.stream()
.filter(block -> region.getTestblockArea().inRegion(block.getLocation(), true))
.collect(Collectors.toList());
if (blockList.isEmpty()) {
return;
}