From 78c6ae3b90e39253fad5cbe8a3c389d8f30a8c36 Mon Sep 17 00:00:00 2001 From: TomTheFurry Date: Tue, 26 Jul 2022 22:20:26 +0800 Subject: [PATCH] Hey Fixed more maths! --- .../com/seibel/lod/core/a7/generation/GenerationQueue.java | 7 +++++-- src/main/java/com/seibel/lod/core/a7/pos/DhLodPos.java | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/seibel/lod/core/a7/generation/GenerationQueue.java b/src/main/java/com/seibel/lod/core/a7/generation/GenerationQueue.java index 7a6e9aa9c..7da2276ee 100644 --- a/src/main/java/com/seibel/lod/core/a7/generation/GenerationQueue.java +++ b/src/main/java/com/seibel/lod/core/a7/generation/GenerationQueue.java @@ -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; }); } diff --git a/src/main/java/com/seibel/lod/core/a7/pos/DhLodPos.java b/src/main/java/com/seibel/lod/core/a7/pos/DhLodPos.java index 0a28e0923..1abb54dfa 100644 --- a/src/main/java/com/seibel/lod/core/a7/pos/DhLodPos.java +++ b/src/main/java/com/seibel/lod/core/a7/pos/DhLodPos.java @@ -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)); } }