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;
|
package me.cortex.zenith.client.config;
|
||||||
|
|
||||||
|
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||||
|
|
||||||
public class ZenithConfigScreenFactory implements 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.client.core.other.ColourResolver;
|
||||||
import me.cortex.zenith.common.world.other.Mapper;
|
import me.cortex.zenith.common.world.other.Mapper;
|
||||||
import me.cortex.zenith.client.importers.WorldImporter;
|
import me.cortex.zenith.client.importers.WorldImporter;
|
||||||
import me.cortex.zenith.common.world.storage.SplicedStorageBackendAdaptor;
|
import me.cortex.zenith.common.world.storage.FragmentedStorageBackendAdaptor;
|
||||||
import me.cortex.zenith.common.world.storage.lmdb.LMDBStorageBackend;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.client.render.Camera;
|
import net.minecraft.client.render.Camera;
|
||||||
@@ -39,7 +38,8 @@ import java.util.*;
|
|||||||
//Ingest -> world engine -> raw render data -> render data
|
//Ingest -> world engine -> raw render data -> render data
|
||||||
public class VoxelCore {
|
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,
|
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.SPRUCE_LEAVES,
|
||||||
Blocks.BIRCH_LEAVES,
|
Blocks.BIRCH_LEAVES,
|
||||||
@@ -66,7 +66,7 @@ public class VoxelCore {
|
|||||||
SharedIndexBuffer.INSTANCE.id();
|
SharedIndexBuffer.INSTANCE.id();
|
||||||
this.renderer = new Gl46FarWorldRenderer();
|
this.renderer = new Gl46FarWorldRenderer();
|
||||||
System.out.println("Renderer initialized");
|
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");
|
System.out.println("World engine");
|
||||||
|
|
||||||
this.renderTracker = new RenderTracker(this.world, this.renderer);
|
this.renderTracker = new RenderTracker(this.world, this.renderer);
|
||||||
@@ -76,7 +76,7 @@ public class VoxelCore {
|
|||||||
System.out.println("Render tracker and generator initialized");
|
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
|
//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");
|
System.out.println("Distance tracker initialized");
|
||||||
|
|
||||||
this.postProcessing = null;//new PostProcessing();
|
this.postProcessing = null;//new PostProcessing();
|
||||||
|
|||||||
@@ -111,8 +111,9 @@ public class Gl46FarWorldRenderer extends AbstractFarWorldRenderer {
|
|||||||
glDepthMask(false);
|
glDepthMask(false);
|
||||||
|
|
||||||
//glEnable(GL_REPRESENTATIVE_FRAGMENT_TEST_NV);
|
//glEnable(GL_REPRESENTATIVE_FRAGMENT_TEST_NV);
|
||||||
|
|
||||||
glDrawElementsInstanced(GL_TRIANGLES, 6 * 2 * 3, GL_UNSIGNED_BYTE, (1 << 16) * 6 * 2, this.geometry.getSectionCount());
|
glDrawElementsInstanced(GL_TRIANGLES, 6 * 2 * 3, GL_UNSIGNED_BYTE, (1 << 16) * 6 * 2, this.geometry.getSectionCount());
|
||||||
|
//glDisable(GL_REPRESENTATIVE_FRAGMENT_TEST_NV);
|
||||||
|
|
||||||
glDepthMask(true);
|
glDepthMask(true);
|
||||||
glColorMask(true, true, true, true);
|
glColorMask(true, true, true, true);
|
||||||
glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT);
|
glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
|||||||
|
|
||||||
@Mixin(ClientChunkManager.class)
|
@Mixin(ClientChunkManager.class)
|
||||||
public class MixinClientChunkManager {
|
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) {
|
private void injectUnload(ChunkPos pos, CallbackInfo ci, int index, WorldChunk worldChunk) {
|
||||||
var core = ((IGetVoxelCore)MinecraftClient.getInstance().worldRenderer).getVoxelCore();
|
var core = ((IGetVoxelCore)MinecraftClient.getInstance().worldRenderer).getVoxelCore();
|
||||||
if (core != null) {
|
if (core != null) {
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import java.io.File;
|
|||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
//Segments the section data into multiple dbs
|
//Segments the section data into multiple dbs
|
||||||
public class SplicedStorageBackendAdaptor extends StorageBackend {
|
public class FragmentedStorageBackendAdaptor extends StorageBackend {
|
||||||
private final StorageBackend[] backends = new StorageBackend[32];
|
private final StorageBackend[] backends = new StorageBackend[32];
|
||||||
|
|
||||||
public SplicedStorageBackendAdaptor() {
|
public FragmentedStorageBackendAdaptor() {
|
||||||
for (int i = 0; i < this.backends.length; i++) {
|
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