Added unit tests for regions (now requires cache at Server/src/resources/cache)

Reverted some really old changes (2019) to house loading code (Might fix construction? Probably not.)
This commit is contained in:
Ceikry
2022-04-25 12:15:56 +00:00
committed by Ryan
parent eab32ccef8
commit 933dc72a48
2 changed files with 122 additions and 6 deletions
@@ -378,12 +378,11 @@ public final class HouseManager {
Region.load(from, true);
RegionChunk defaultChunk = from.getPlanes()[style.getPlane()].getRegionChunk(1, 0);
RegionChunk defaultSkyChunk = from.getPlanes()[1].getRegionChunk(0,0);
ZoneBorders borders;
//DynamicRegion[] regions = DynamicRegion.create(borders);
region = DynamicRegion.create(style.getRegionId());
/* region.setBorders(borders);
ZoneBorders borders = DynamicRegion.reserveArea(8,8);
region = new DynamicRegion(-1, borders.getSouthWestX() >> 6, borders.getSouthWestY() >> 6);
region.setBorders(borders);
region.setUpdateAllPlanes(true);
RegionManager.addRegion(region.getId(), region);*/
RegionManager.addRegion(region.getId(), region);
configureRoofs();
for (int z = 0; z < 4; z++) {
for (int x = 0; x < 8; x++) {
@@ -401,7 +400,7 @@ public final class HouseManager {
region.replaceChunk(z, x, y, copy, from);
room.loadDecorations(z, copy, this);
} else {
region.replaceChunk(z, x, y, z != 0 ? defaultSkyChunk.copy(region.getPlanes()[z]) : defaultChunk.copy(region.getPlanes()[0]), from);
region.replaceChunk(z, x, y, z != 0 ? null : defaultChunk.copy(region.getPlanes()[0]), from);
}
}
}