E
This commit is contained in:
@@ -20,6 +20,7 @@ public class VoxyConfig {
|
|||||||
public static VoxyConfig CONFIG = loadOrCreate();
|
public static VoxyConfig CONFIG = loadOrCreate();
|
||||||
|
|
||||||
public boolean enabled = true;
|
public boolean enabled = true;
|
||||||
|
public boolean ingestEnabled = true;
|
||||||
public int qualityScale = 20;
|
public int qualityScale = 20;
|
||||||
public int maxSections = 200_000;
|
public int maxSections = 200_000;
|
||||||
public int geometryBufferSize = (1<<30)/8;
|
public int geometryBufferSize = (1<<30)/8;
|
||||||
|
|||||||
@@ -67,6 +67,12 @@ public class VoxyConfigScreenFactory implements ModMenuApi {
|
|||||||
.setDefaultValue(DEFAULT.enabled)
|
.setDefaultValue(DEFAULT.enabled)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder.startBooleanToggle(Text.translatable("voxy.config.general.ingest"), config.ingestEnabled)
|
||||||
|
.setTooltip(Text.translatable("voxy.config.general.ingest.tooltip"))
|
||||||
|
.setSaveConsumer(val -> config.ingestEnabled = val)
|
||||||
|
.setDefaultValue(DEFAULT.ingestEnabled)
|
||||||
|
.build());
|
||||||
|
|
||||||
category.addEntry(entryBuilder.startIntSlider(Text.translatable("voxy.config.general.quality"), config.qualityScale, 8, 50)
|
category.addEntry(entryBuilder.startIntSlider(Text.translatable("voxy.config.general.quality"), config.qualityScale, 8, 50)
|
||||||
.setTooltip(Text.translatable("voxy.config.general.quality.tooltip"))
|
.setTooltip(Text.translatable("voxy.config.general.quality.tooltip"))
|
||||||
.setSaveConsumer(val -> config.qualityScale = val)
|
.setSaveConsumer(val -> config.qualityScale = val)
|
||||||
|
|||||||
@@ -78,11 +78,13 @@ public class VoxelCore {
|
|||||||
|
|
||||||
var biomeRegistry = MinecraftClient.getInstance().world.getRegistryManager().get(RegistryKeys.BIOME);
|
var biomeRegistry = MinecraftClient.getInstance().world.getRegistryManager().get(RegistryKeys.BIOME);
|
||||||
for (var biome : this.world.getMapper().getBiomeEntries()) {
|
for (var biome : this.world.getMapper().getBiomeEntries()) {
|
||||||
this.renderer.getModelManager().addBiome(biome.id, biomeRegistry.get(new Identifier(biome.biome)));
|
//this.renderer.getModelManager().addBiome(biome.id, biomeRegistry.get(new Identifier(biome.biome)));
|
||||||
|
this.renderer.addBiome(biome);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var state : this.world.getMapper().getStateEntries()) {
|
for (var state : this.world.getMapper().getStateEntries()) {
|
||||||
this.renderer.getModelManager().addEntry(state.id, state.state);
|
//this.renderer.getModelManager().addEntry(state.id, state.state);
|
||||||
|
this.renderer.addBlockState(state);
|
||||||
}
|
}
|
||||||
//this.renderer.getModelManager().updateEntry(0, Blocks.GRASS_BLOCK.getDefaultState());
|
//this.renderer.getModelManager().updateEntry(0, Blocks.GRASS_BLOCK.getDefaultState());
|
||||||
|
|
||||||
|
|||||||
@@ -105,8 +105,10 @@ public abstract class AbstractFarWorldRenderer {
|
|||||||
UploadStream.INSTANCE.commit();
|
UploadStream.INSTANCE.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int maxUpdatesPerFrame = 30;
|
||||||
|
|
||||||
//Do any BlockChanges
|
//Do any BlockChanges
|
||||||
while (!this.blockStateUpdates.isEmpty()) {
|
while ((!this.blockStateUpdates.isEmpty()) && (maxUpdatesPerFrame-- > 0)) {
|
||||||
var update = this.blockStateUpdates.pop();
|
var update = this.blockStateUpdates.pop();
|
||||||
this.models.addEntry(update.id, update.state);
|
this.models.addEntry(update.id, update.state);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package me.cortex.voxy.client.mixin.minecraft;
|
package me.cortex.voxy.client.mixin.minecraft;
|
||||||
|
|
||||||
|
import me.cortex.voxy.client.config.VoxyConfig;
|
||||||
import me.cortex.voxy.client.core.IGetVoxelCore;
|
import me.cortex.voxy.client.core.IGetVoxelCore;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.world.ClientChunkManager;
|
import net.minecraft.client.world.ClientChunkManager;
|
||||||
@@ -21,7 +22,7 @@ public class MixinClientChunkManager {
|
|||||||
@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)
|
@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)(world.worldRenderer)).getVoxelCore();
|
var core = ((IGetVoxelCore)(world.worldRenderer)).getVoxelCore();
|
||||||
if (core != null) {
|
if (core != null && VoxyConfig.CONFIG.ingestEnabled) {
|
||||||
core.enqueueIngest(worldChunk);
|
core.enqueueIngest(worldChunk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user