Skip to content

Commit

Permalink
add little road data setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Abelkrijgtalles committed Dec 15, 2024
1 parent 0c278ec commit 47315c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.util.List;
import net.minecraft.DetectedVersion;
import nl.abelkrijgtalles.mojangmaps.common.config.roads.RoadData;
import nl.abelkrijgtalles.mojangmaps.common.platform.LoaderInfo;
import nl.abelkrijgtalles.mojangmaps.common.platform.config.ConfigItem;
import nl.abelkrijgtalles.mojangmaps.common.platform.config.ConfigObject;
Expand All @@ -35,9 +36,10 @@ public class MojangMaps {
public static void init(LoaderInfo loaderInfo) {

MojangMaps.loaderInfo = loaderInfo;

LOGGER.info("Running Mojang Maps on Minecraft version {}.", DetectedVersion.tryDetectVersion().getName());
LOGGER.info(loaderInfo.getConfig().get("message"));

RoadData roadData = new RoadData();
if (!loaderInfo.isRunningTests()) roadData.setupRoadData();

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,16 @@ private byte[] convertByteListToArray(List<Byte> byteList) {

}

public List<Road> setupRoadData() {

if (FILE_PATH.toFile().exists()) return readRoadData();
else {

generateRoadData(new ArrayList<>());
return new ArrayList<>();

}

}

}

0 comments on commit 47315c1

Please sign in to comment.