clean up ChunkGenerator

This commit is contained in:
dfsek
2021-11-27 08:55:40 -07:00
parent 7a3597a722
commit 50da6d9d9b
7 changed files with 21 additions and 15 deletions
@@ -55,7 +55,7 @@ import java.util.concurrent.Executor;
import com.dfsek.terra.api.config.ConfigPack;
import com.dfsek.terra.api.world.World;
import com.dfsek.terra.api.world.generator.ChunkData;
import com.dfsek.terra.api.world.generator.ProtoChunk;
import com.dfsek.terra.api.world.generator.ChunkGenerator;
import com.dfsek.terra.api.world.generator.Chunkified;
import com.dfsek.terra.api.world.generator.GeneratorWrapper;
@@ -193,7 +193,7 @@ public class FabricChunkGeneratorWrapper extends net.minecraft.world.gen.chunk.C
public CompletableFuture<Chunk> populateNoise(Executor executor, Blender arg, StructureAccessor structureAccessor, Chunk chunk) {
return CompletableFuture.supplyAsync(() -> {
World world = (World) ((StructureAccessorAccessor) structureAccessor).getWorld();
delegate.generateChunkData(world, new FastRandom(), chunk.getPos().x, chunk.getPos().z, (ChunkData) chunk);
delegate.generateChunkData(world, new FastRandom(), chunk.getPos().x, chunk.getPos().z, (ProtoChunk) chunk);
delegate.getGenerationStages().forEach(populator -> {
if(populator instanceof Chunkified) {
populator.populate(world, (com.dfsek.terra.api.world.Chunk) world);
@@ -18,7 +18,6 @@
package com.dfsek.terra.fabric.mixin.implementations.chunk.data;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.chunk.ProtoChunk;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Implements;
import org.spongepowered.asm.mixin.Interface;
@@ -27,12 +26,12 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import com.dfsek.terra.api.block.state.BlockState;
import com.dfsek.terra.api.world.generator.ChunkData;
import com.dfsek.terra.api.world.generator.ProtoChunk;
import com.dfsek.terra.fabric.block.FabricBlockState;
@Mixin(ProtoChunk.class)
@Implements(@Interface(iface = ChunkData.class, prefix = "terra$", remap = Interface.Remap.NONE))
@Mixin(net.minecraft.world.chunk.ProtoChunk.class)
@Implements(@Interface(iface = ProtoChunk.class, prefix = "terra$", remap = Interface.Remap.NONE))
public abstract class ProtoChunkMixin {
@Shadow
public abstract net.minecraft.block.BlockState getBlockState(BlockPos pos);