LiminalWheatWorld
Create a Fabric 1.21 mod called "Liminal Wheat World". When creating a new world with this mod enabled, the Overworld should generate as: - Infinite completely flat terrain. - Layers: - Bedrock - Dirt - Dirt - Dirt - Farmland - Every farmland block must have fully-grown wheat (minecraft:wheat age=7). - No trees. - No flowers. - No grass. - No tall grass. - No ferns. - No sugar cane. - No pumpkins. - No melons. - No caves visible from the surface. - No lakes. - No rivers. - No structures. - No villages. - No ruined portals. - No mineshafts. - No strongholds. - No animals.
Read the full description
- No hostile mobs. - Use a single Plains biome everywhere. - The world should be compatible with Minecraft Java 1.21.x. Generate a complete Gradle Fabric project that builds successfully with Fabric Loom. Do not use placeholders or pseudocode. Implement the world generation in Java.
package eu.codexe.liminalwheatworld.world;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.block.Blocks;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.structure.StructureManager;
import net.minecraft.util.dynamic.Codecs;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.ChunkRegion;
import net.minecraft.world.Heightmap;
import net.minecraft.world.biome.source.BiomeSource;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.chunk.VerticalBlockSample;
import net.minecraft.world.gen.noise.NoiseConfig;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
public class LiminalChunkGenerator extends ChunkGenerator {
public static final Codec<LiminalChunkGenerator> CODEC = RecordCodecBuilder.create(instance ->
instance.group(
BiomeSource.CODEC.fieldOf("biome_source").forGetter(g -> g.biomeSource)
).apply(instance, LiminalChunkGenerator::new)
);
public LiminalChunkGenerator(BiomeSource biomeSource) {
super(biomeSource);
}
@Override
protected Codec<? extends ChunkGenerator> getCodec() {
return CODEC;
}
@Override
public void carve(ChunkRegion chunkRegion, long seed, NoiseConfig noiseConfig, Chunk chunk, GenerationStep.Carver carver) {
// No carving
}
@Override
public void generateFeatures(StructureManager structureManager, ChunkRegion region, long seed, NoiseConfig noiseConfig) {
// No features
}
@Override
public CompletableFuture<Chunk> populateNoise(Executor executor, NoiseConfig noiseConfig, StructureManager structureManager, Chunk chunk) {
return CompletableFuture.completedFuture(chunk);
}
@Override
public int getHeight(int x, int z, Heightmap.Type heightmapType, NoiseConfig noiseConfig) {
return 64; // Farmland layer height
}
@Override