Dev work
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
package me.cortex.zenith.client.config;
|
||||
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
|
||||
public class ScreenFactory implements ModMenuApi {
|
||||
@Override
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return parent -> null;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
package me.cortex.zenith.client.config;
|
||||
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
|
||||
public class ZenithConfigScreenFactory implements ModMenuApi {
|
||||
|
||||
@Override
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return parent -> null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,7 @@ import me.cortex.zenith.client.core.other.BlockStateColour;
|
||||
import me.cortex.zenith.client.core.other.ColourResolver;
|
||||
import me.cortex.zenith.common.world.other.Mapper;
|
||||
import me.cortex.zenith.client.importers.WorldImporter;
|
||||
import me.cortex.zenith.common.world.storage.SplicedStorageBackendAdaptor;
|
||||
import me.cortex.zenith.common.world.storage.lmdb.LMDBStorageBackend;
|
||||
import me.cortex.zenith.common.world.storage.FragmentedStorageBackendAdaptor;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.client.render.Camera;
|
||||
@@ -39,7 +38,8 @@ import java.util.*;
|
||||
//Ingest -> world engine -> raw render data -> render data
|
||||
public class VoxelCore {
|
||||
private static final Set<Block> biomeTintableAllFaces = new HashSet<>(List.of(Blocks.OAK_LEAVES, Blocks.JUNGLE_LEAVES, Blocks.ACACIA_LEAVES, Blocks.DARK_OAK_LEAVES, Blocks.VINE, Blocks.MANGROVE_LEAVES,
|
||||
Blocks.TALL_GRASS, Blocks.LARGE_FERN, Blocks.SHORT_GRASS,
|
||||
Blocks.TALL_GRASS, Blocks.LARGE_FERN,
|
||||
//Blocks.SHORT_GRASS,
|
||||
|
||||
Blocks.SPRUCE_LEAVES,
|
||||
Blocks.BIRCH_LEAVES,
|
||||
@@ -66,7 +66,7 @@ public class VoxelCore {
|
||||
SharedIndexBuffer.INSTANCE.id();
|
||||
this.renderer = new Gl46FarWorldRenderer();
|
||||
System.out.println("Renderer initialized");
|
||||
this.world = new WorldEngine(new SplicedStorageBackendAdaptor(), 2, 20, 5);//"storagefile.db"//"ethoslab.db"
|
||||
this.world = new WorldEngine(new FragmentedStorageBackendAdaptor(), 4, 20, 5);//"storagefile.db"//"ethoslab.db"
|
||||
System.out.println("World engine");
|
||||
|
||||
this.renderTracker = new RenderTracker(this.world, this.renderer);
|
||||
@@ -76,7 +76,7 @@ public class VoxelCore {
|
||||
System.out.println("Render tracker and generator initialized");
|
||||
|
||||
//To get to chunk scale multiply the scale by 2, the scale is after how many chunks does the lods halve
|
||||
this.distanceTracker = new DistanceTracker(this.renderTracker, 5, 64);//16
|
||||
this.distanceTracker = new DistanceTracker(this.renderTracker, 5, 64);//16//64
|
||||
System.out.println("Distance tracker initialized");
|
||||
|
||||
this.postProcessing = null;//new PostProcessing();
|
||||
|
||||
@@ -111,8 +111,9 @@ public class Gl46FarWorldRenderer extends AbstractFarWorldRenderer {
|
||||
glDepthMask(false);
|
||||
|
||||
//glEnable(GL_REPRESENTATIVE_FRAGMENT_TEST_NV);
|
||||
|
||||
glDrawElementsInstanced(GL_TRIANGLES, 6 * 2 * 3, GL_UNSIGNED_BYTE, (1 << 16) * 6 * 2, this.geometry.getSectionCount());
|
||||
//glDisable(GL_REPRESENTATIVE_FRAGMENT_TEST_NV);
|
||||
|
||||
glDepthMask(true);
|
||||
glColorMask(true, true, true, true);
|
||||
glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT);
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
@Mixin(ClientChunkManager.class)
|
||||
public class MixinClientChunkManager {
|
||||
@Inject(method = "unload", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientChunkManager$ClientChunkMap;compareAndSet(ILnet/minecraft/world/chunk/WorldChunk;Lnet/minecraft/world/chunk/WorldChunk;)Lnet/minecraft/world/chunk/WorldChunk;", shift = At.Shift.BEFORE), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
@Inject(require = 0, method = "unload", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/world/ClientChunkManager$ClientChunkMap;compareAndSet(ILnet/minecraft/world/chunk/WorldChunk;Lnet/minecraft/world/chunk/WorldChunk;)Lnet/minecraft/world/chunk/WorldChunk;", shift = At.Shift.BEFORE), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
private void injectUnload(ChunkPos pos, CallbackInfo ci, int index, WorldChunk worldChunk) {
|
||||
var core = ((IGetVoxelCore)MinecraftClient.getInstance().worldRenderer).getVoxelCore();
|
||||
if (core != null) {
|
||||
|
||||
@@ -8,12 +8,12 @@ import java.io.File;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
//Segments the section data into multiple dbs
|
||||
public class SplicedStorageBackendAdaptor extends StorageBackend {
|
||||
public class FragmentedStorageBackendAdaptor extends StorageBackend {
|
||||
private final StorageBackend[] backends = new StorageBackend[32];
|
||||
|
||||
public SplicedStorageBackendAdaptor() {
|
||||
public FragmentedStorageBackendAdaptor() {
|
||||
for (int i = 0; i < this.backends.length; i++) {
|
||||
this.backends[i] = new LMDBStorageBackend(new File("db_store/storage-db-"+i+".db"));
|
||||
this.backends[i] = new LMDBStorageBackend(new File("storage-db-"+i+".db"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user