Update DepthCounterListener to count extension area as well
Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
1a1f7b49b3
Commit
399171f58e
@ -40,15 +40,12 @@ public class DepthCounterListener implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEntityExplode(EntityExplodeEvent event) {
|
public void onEntityExplode(EntityExplodeEvent event) {
|
||||||
Region region = Region.getRegion(event.getLocation());
|
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) {
|
if (!testblock) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DepthCounter.depthMap.containsKey(region)) {
|
DepthCounter.depthMap.computeIfAbsent(region, r -> new HashSet<>());
|
||||||
DepthCounter.depthMap.put(region, new HashSet<>());
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<Depth> depthSet = DepthCounter.depthMap.get(region);
|
Set<Depth> depthSet = DepthCounter.depthMap.get(region);
|
||||||
for (Depth depth : depthSet) {
|
for (Depth depth : depthSet) {
|
||||||
if (depth.update(event.blockList())) {
|
if (depth.update(event.blockList())) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren