Add TNT only making Damage in spawning Region

This commit is contained in:
2026-03-06 16:13:41 +01:00
parent 3fe28cfba9
commit 271110d9e3
3 changed files with 17 additions and 0 deletions
@@ -76,6 +76,12 @@ public interface RegionSystem {
@NonNull @NonNull
Stream<Region> getRegions(); Stream<Region> getRegions();
/**
* Only contains Regions of the same Type as the one you inputted.
*/
@NonNull
Stream<Region> getConnectedRegions(Region region);
private static RegionSystem init() { private static RegionSystem init() {
if (Core.getVersion() >= 21) { if (Core.getVersion() >= 21) {
// TODO: Add some kind of detection if the DynamicRegionSystem should be used! // TODO: Add some kind of detection if the DynamicRegionSystem should be used!
@@ -122,6 +128,11 @@ public interface RegionSystem {
public Stream<Region> getRegions() { public Stream<Region> getRegions() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override
public @NonNull Stream<Region> getConnectedRegions(Region region) {
throw new UnsupportedOperationException();
}
}; };
} }
} }
@@ -164,6 +164,7 @@ public class DynamicRegionSystem implements RegionSystem {
.map(DynamicRegion.class::cast); .map(DynamicRegion.class::cast);
} }
@Override
public Stream<Region> getConnectedRegions(Region region) { public Stream<Region> getConnectedRegions(Region region) {
Set<Region> regions = regionTypeMap.get(region.getType()); Set<Region> regions = regionTypeMap.get(region.getType());
@@ -75,4 +75,9 @@ public class FixedRegionSystem implements RegionSystem {
public Stream<Region> getRegions() { public Stream<Region> getRegions() {
return REGION_MAP.values().stream(); return REGION_MAP.values().stream();
} }
@Override
public @NonNull Stream<Region> getConnectedRegions(Region region) {
return Stream.empty();
}
} }