forked from SteamWar/SteamWar
Update Region System of BauSystem
This commit is contained in:
+4
-4
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user