forked from SteamWar/SteamWar
Add TNT only making Damage in spawning Region
This commit is contained in:
@@ -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();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -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());
|
||||||
|
|
||||||
|
|||||||
+5
@@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user