diff --git a/core/src/main/java/com/seibel/distanthorizons/core/pos/OldDhSectionPos.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/OldDhSectionPos.java index ce5544afa..2c2aaadde 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/pos/OldDhSectionPos.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/pos/OldDhSectionPos.java @@ -175,16 +175,6 @@ public class OldDhSectionPos this.z * BitShiftUtil.powerOfTwo(offset)); } - public OldDhSectionPos getMinCornerPos(byte returnDetailLevel) - { - LodUtil.assertTrue(returnDetailLevel <= this.detailLevel, "returnDetailLevel must be less than sectionDetail"); - - byte offset = (byte) (this.detailLevel - returnDetailLevel); - return new OldDhSectionPos(returnDetailLevel, - this.x * BitShiftUtil.powerOfTwo(offset), - this.z * BitShiftUtil.powerOfTwo(offset)); - } - /** * A detail level of X lower than this section's detail level will return:
* 0 -> 1
@@ -291,27 +281,6 @@ public class OldDhSectionPos // comparisons // //=============// - public boolean overlapsExactly(OldDhSectionPos other) - { - // original logic from DhLodPos - if (this.equals(other)) - { - return true; - } - else if (this.detailLevel == other.detailLevel) - { - return false; - } - else if (this.detailLevel > other.detailLevel) - { - return this.equals(other.convertNewToDetailLevel(this.detailLevel)); - } - else - { - return other.equals(this.convertNewToDetailLevel(other.detailLevel)); - } - } - public boolean contains(OldDhSectionPos otherPos) { DhBlockPos2D thisMinBlockPos = this.getMinCornerLodPos(LodUtil.BLOCK_DETAIL_LEVEL).getCornerBlockPos(); @@ -383,27 +352,6 @@ public class OldDhSectionPos - - - //===============// - // serialization // - //===============// - - /** Serialize() is different from toString() as it must NEVER be changed, and should be in a short format */ - public String serialize() { return "[" + this.detailLevel + ',' + this.x + ',' + this.z + ']'; } - - @Nullable - public static OldDhSectionPos deserialize(String value) - { - if (value.charAt(0) != '[' || value.charAt(value.length() - 1) != ']') return null; - String[] split = value.substring(1, value.length() - 1).split(","); - if (split.length != 3) return null; - return new OldDhSectionPos(Byte.parseByte(split[0]), Integer.parseInt(split[1]), Integer.parseInt(split[2])); - - } - - - //===========// // overrides // //===========// diff --git a/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/FullDataSourceV1Repo.java b/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/FullDataSourceV1Repo.java index 65d1f10c4..062dec00d 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/FullDataSourceV1Repo.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/sql/repo/FullDataSourceV1Repo.java @@ -20,9 +20,11 @@ package com.seibel.distanthorizons.core.sql.repo; import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiWorldGenerationStep; +import com.seibel.distanthorizons.core.pos.DhSectionPos; import com.seibel.distanthorizons.core.pos.OldDhSectionPos; import com.seibel.distanthorizons.core.sql.dto.FullDataSourceV1DTO; import com.seibel.distanthorizons.coreapi.util.StringUtil; +import org.jetbrains.annotations.Nullable; import java.sql.PreparedStatement; import java.sql.SQLException; @@ -55,7 +57,7 @@ public class FullDataSourceV1Repo extends AbstractDhRepo objectMap) throws ClassCastException { String posString = (String) objectMap.get("DhSectionPos"); - OldDhSectionPos pos = OldDhSectionPos.deserialize(posString); + OldDhSectionPos pos = deserializeSectionPos(posString); // meta data int checksum = (Integer) objectMap.get("Checksum"); @@ -106,7 +108,7 @@ public class FullDataSourceV1Repo extends AbstractDhRepo resultMap : resultMapList) { // returned in the format [sectionDetailLevel,x,z] IE [6,0,0] - OldDhSectionPos sectionPos = OldDhSectionPos.deserialize((String) resultMap.get("DhSectionPos")); + OldDhSectionPos sectionPos = deserializeSectionPos((String) resultMap.get("DhSectionPos")); list.add(sectionPos); } @@ -230,7 +232,7 @@ public class FullDataSourceV1Repo extends AbstractDhRepo