Hey Fixed more maths!

This commit is contained in:
TomTheFurry
2022-07-26 22:20:26 +08:00
parent 50810c7406
commit 78c6ae3b90
2 changed files with 7 additions and 4 deletions
@@ -133,13 +133,16 @@ public class GenerationQueue implements PlaceHolderQueue {
final byte sectionDetail = (byte) (dataDetail + FullDataSource.SECTION_SIZE_OFFSET);
data.forEachPos((x,z) -> {
ChunkSizedData chunkData = data.get(x,z);
DhLodPos chunkDataPos = new DhLodPos((byte) (dataDetail + 4), x, z).convertUpwardsTo(sectionDetail);
DhLodPos chunkDataPos = new DhLodPos((byte)(chunkData.dataDetail + 4), chunkData.x, chunkData.z).convertUpwardsTo(sectionDetail);
DhSectionPos sectionPos = new DhSectionPos(chunkDataPos.detail, chunkDataPos.x, chunkDataPos.z);
logger.info("Writing chunk {} with data detail {} to section {}",
new DHChunkPos(x+chunkPosMin.x,z+chunkPosMin.z),
chunkDataPos,
dataDetail, sectionPos);
write(sectionPos, chunkData);
});
}).exceptionally(ex -> {
logger.error("Error generating data for section {}", pos, ex);
return null;
});
}
@@ -63,9 +63,9 @@ public class DhLodPos {
if (equals(other)) return true;
if (detail == other.detail) return false;
if (detail > other.detail) {
return other.equals(this.convertUpwardsTo(other.detail));
} else {
return this.equals(other.convertUpwardsTo(this.detail));
} else {
return other.equals(this.convertUpwardsTo(other.detail));
}
}