Experiments
This commit is contained in:
@@ -36,7 +36,7 @@ dependencies {
|
||||
modImplementation(fabricApi.module("fabric-command-api-v2", project.fabric_version))
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-rendering-data-attachment-v1:0.3.38+73761d2e9a")
|
||||
|
||||
modImplementation "maven.modrinth:sodium:mc1.20.2-0.5.3"
|
||||
modImplementation "maven.modrinth:sodium:mc1.20.3-0.5.5"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.20.2
|
||||
yarn_mappings=1.20.2+build.1
|
||||
minecraft_version=1.20.4
|
||||
yarn_mappings=1.20.4+build.1
|
||||
loader_version=0.14.22
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 0.0.1
|
||||
maven_group = me.cortex
|
||||
archives_base_name = voxelmon
|
||||
archives_base_name = zenith
|
||||
|
||||
fabric_version=0.89.0+1.20.2
|
||||
|
||||
@@ -57,6 +57,5 @@ public class Test {
|
||||
//WorldEngine engine = new WorldEngine(new File("storagefile2.db"), 5);
|
||||
WorldImporter importer = new WorldImporter(null, null);
|
||||
//importer.importWorld(new File("run/saves/Drehmal 2.2 Apotheosis Beta - 1.0.0/region/"));
|
||||
importer.importWorldAsyncStart(new File("D:\\PrismLauncher-Windows-MSVC-Portable-7.1\\instances\\1.20.1(3)\\.minecraft\\.bobby\\build.docm77.de\\-8149132374211427218\\minecraft\\overworld\\"), 2,null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,5 +203,9 @@ public class DistanceTracker {
|
||||
});
|
||||
ops.clear();
|
||||
}
|
||||
|
||||
public void fill() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package me.cortex.voxelmon.core;
|
||||
|
||||
//Tracks the distance with respect to the entire world size
|
||||
public class TreeDistanceTracker {
|
||||
private final int scalingFactor;
|
||||
|
||||
public TreeDistanceTracker(int scalingFactor) {
|
||||
this.scalingFactor = scalingFactor;
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public class VoxelCore {
|
||||
Blocks.SPRUCE_LEAVES,
|
||||
Blocks.BIRCH_LEAVES,
|
||||
Blocks.PINK_PETALS,
|
||||
Blocks.FERN, Blocks.GRASS, Blocks.POTTED_FERN));
|
||||
Blocks.FERN, Blocks.POTTED_FERN));
|
||||
private static final Set<Block> biomeTintableUpFace = new HashSet<>(List.of(Blocks.GRASS_BLOCK));
|
||||
private static final Set<Block> waterTint = new HashSet<>(List.of(Blocks.WATER));
|
||||
|
||||
@@ -73,10 +73,10 @@ public class VoxelCore {
|
||||
//Trigger the shared index buffer loading
|
||||
SharedIndexBuffer.INSTANCE.id();
|
||||
this.renderer = new Gl46FarWorldRenderer();
|
||||
this.world = new WorldEngine(new File("storagefile.db"), 20, 5);//"storagefile.db"//"ethoslab.db"
|
||||
this.world = new WorldEngine(new File("storagefile.db"), 5, 20, 5);//"storagefile.db"//"ethoslab.db"
|
||||
|
||||
this.renderTracker = new RenderTracker(this.world, this.renderer);
|
||||
this.renderGen = new RenderGenerationService(this.world,4, this.renderTracker::processBuildResult);
|
||||
this.renderGen = new RenderGenerationService(this.world,10, this.renderTracker::processBuildResult);
|
||||
this.world.setRenderTracker(this.renderTracker);
|
||||
this.renderTracker.setRenderGen(this.renderGen);
|
||||
|
||||
|
||||
@@ -35,14 +35,14 @@ public class WorldEngine {
|
||||
private final int maxMipLevels;
|
||||
|
||||
|
||||
public WorldEngine(File storagePath, int savingServiceWorkers, int maxMipLayers) {
|
||||
public WorldEngine(File storagePath, int ingestWorkers, int savingServiceWorkers, int maxMipLayers) {
|
||||
this.maxMipLevels = maxMipLayers;
|
||||
this.storage = new StorageBackend(storagePath);
|
||||
this.mapper = new Mapper(this.storage);
|
||||
this.sectionTracker = new ActiveSectionTracker(maxMipLayers, this::unsafeLoadSection);
|
||||
|
||||
this.savingService = new SectionSavingService(this, savingServiceWorkers);
|
||||
this.ingestService = new VoxelIngestService(this, 2);
|
||||
this.ingestService = new VoxelIngestService(this, ingestWorkers);
|
||||
}
|
||||
|
||||
private int unsafeLoadSection(WorldSection into) {
|
||||
@@ -89,6 +89,8 @@ public class WorldEngine {
|
||||
this.savingService.enqueueSave(section);
|
||||
}
|
||||
|
||||
|
||||
//TODO: move this to auxilery class so that it can take into account larger than 4 mip levels
|
||||
//Executes an update to the world and automatically updates all the parent mip layers up to level 4 (e.g. where 1 chunk section is 1 block big)
|
||||
public void insertUpdate(VoxelizedSection section) {
|
||||
//The >>1 is cause the world sections size is 32x32x32 vs the 16x16x16 of the voxelized section
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.block.Blocks;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtIo;
|
||||
import net.minecraft.nbt.NbtOps;
|
||||
import net.minecraft.nbt.NbtTagSizeTracker;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.stat.Stat;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
@@ -199,7 +200,7 @@ public class Mapper {
|
||||
|
||||
public static StateEntry deserialize(int id, byte[] data) {
|
||||
try {
|
||||
var compound = NbtIo.readCompressed(new ByteArrayInputStream(data));
|
||||
var compound = NbtIo.readCompressed(new ByteArrayInputStream(data), NbtTagSizeTracker.ofUnlimitedBytes());
|
||||
if (compound.getInt("id") != id) {
|
||||
throw new IllegalStateException("Encoded id != expected id");
|
||||
}
|
||||
@@ -235,7 +236,7 @@ public class Mapper {
|
||||
|
||||
public static BiomeEntry deserialize(int id, byte[] data) {
|
||||
try {
|
||||
var compound = NbtIo.readCompressed(new ByteArrayInputStream(data));
|
||||
var compound = NbtIo.readCompressed(new ByteArrayInputStream(data), NbtTagSizeTracker.ofUnlimitedBytes());
|
||||
if (compound.getInt("id") != id) {
|
||||
throw new IllegalStateException("Encoded id != expected id");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user