Cleanup and add comments

This commit is contained in:
2026-03-06 21:09:09 +01:00
parent 6a4c021b8b
commit 27deebd570
4 changed files with 20 additions and 9 deletions
@@ -26,6 +26,7 @@ import de.steamwar.bausystem.shared.Pair;
import lombok.NonNull;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nullable;
import java.io.BufferedReader;
@@ -138,6 +139,10 @@ public class DynamicRegionSystem implements RegionSystem {
return regionMap.values().stream();
}
public @NonNull Stream<Region> getRegionsByType(RegionType type) {
return regionTypeMap.get(type).stream();
}
private Stream<Pair<Region, NeighbourDirection>> getNeighbours(Region region, boolean noCorners, boolean fastCache, Collection<Region> regions) {
Point minPoint = region.getArea().getMinPoint(false).subtract(TILE_SIZE_ADJUSTED, 0, TILE_SIZE_ADJUSTED);
Point maxPoint = region.getArea().getMaxPoint(false).add(Tile.tileSize, 0, Tile.tileSize);
@@ -175,6 +180,7 @@ public class DynamicRegionSystem implements RegionSystem {
}
@Override
@NotNull
public Stream<Region> getConnectedRegions(Region region) {
Set<Region> regions = regionTypeMap.get(region.getType());