Skip to content

Commit

Permalink
all the ores
Browse files Browse the repository at this point in the history
  • Loading branch information
MBatt1 committed Aug 26, 2023
1 parent 626661b commit 5d49d52
Show file tree
Hide file tree
Showing 26 changed files with 511 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,6 @@ private static <C extends FeatureConfig, F extends Feature<C>> F registerFeature

/* CONFIGURED FEATURES */
// ORES
private static final RegistryEntry<ConfiguredFeature<OreClusterFeatureConfig, ?>> CONFIGURED_NATIVE_COPPER_CLUSTER = register("ore_copper_native", ORE_CLUSTER_FEATURE, Configs.NATIVE_COPPER_ORE_CLUSTER);
public static final RegistryEntry<PlacedFeature> NATIVE_COPPER_ORE_CLUSTER = register("ore_copper_native", CONFIGURED_NATIVE_COPPER_CLUSTER, RarityFilterPlacementModifier.of(6), SquarePlacementModifier.of(), getHeightModifier(5,160), BiomePlacementModifier.of());

private static final RegistryEntry<ConfiguredFeature<OreClusterFeatureConfig, ?>> CONFIGURED_MALACHITE_COPPER_CLUSTER = register("ore_copper_malachite", ORE_CLUSTER_FEATURE, Configs.MALACHITE_COPPER_ORE_CLUSTER);
public static final RegistryEntry<PlacedFeature> MALACHITE_COPPER_ORE_CLUSTER = register("ore_copper_malachite", CONFIGURED_MALACHITE_COPPER_CLUSTER, RarityFilterPlacementModifier.of(10), SquarePlacementModifier.of(), getHeightModifier(-20,120), BiomePlacementModifier.of());

private static final RegistryEntry<ConfiguredFeature<OreClusterFeatureConfig, ?>> CONFIGURED_CASSITERITE_TIN_CLUSTER = register("ore_tin_cassiterite", ORE_CLUSTER_FEATURE, Configs.CASSITERITE_TIN_ORE_CLUSTER);
public static final RegistryEntry<PlacedFeature> CASSITERITE_TIN_ORE_CLUSTER = register("ore_tin_cassiterite", CONFIGURED_CASSITERITE_TIN_CLUSTER, RarityFilterPlacementModifier.of(12), SquarePlacementModifier.of(), getHeightModifier(30,100), BiomePlacementModifier.of());

private static final RegistryEntry<ConfiguredFeature<OreClusterFeatureConfig, ?>> CONFIGURED_SPHALERITE_ZINC_CLUSTER = register("ore_zinc_sphalerite", ORE_CLUSTER_FEATURE, Configs.SPHALERITE_ZINC_ORE_CLUSTER);
public static final RegistryEntry<PlacedFeature> SPHALERITE_ZINC_ORE_CLUSTER = register("ore_zinc_sphalerite", CONFIGURED_SPHALERITE_ZINC_CLUSTER, RarityFilterPlacementModifier.of(14), SquarePlacementModifier.of(), getHeightModifier(-20,120), BiomePlacementModifier.of());

private static final RegistryEntry<ConfiguredFeature<OreClusterFeatureConfig, ?>> CONFIGURED_LAZURITE_CLUSTER = register("ore_lazurite", ORE_CLUSTER_FEATURE, Configs.LAZURITE_ORE_CLUSTER);
public static final RegistryEntry<PlacedFeature> LAZURITE_ORE_CLUSTER = register("ore_lazurite", CONFIGURED_LAZURITE_CLUSTER, RarityFilterPlacementModifier.of(18), SquarePlacementModifier.of(), getHeightModifier(-60,40), BiomePlacementModifier.of());

private static final RegistryEntry<ConfiguredFeature<OreFeatureConfig, ?>> CONFIGURED_FOSSIL_ORE_BLOBS = register("ore_fossil", Feature.ORE, Configs.FOSSIL_ORE_BLOBS);
public static final RegistryEntry<PlacedFeature> FOSSIL_ORE_BLOBS = register("ore_fossil", CONFIGURED_FOSSIL_ORE_BLOBS, CountPlacementModifier.of(6), SquarePlacementModifier.of(), getHeightModifier(-32,80), BiomePlacementModifier.of());

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package net.cr24.primeval.world.gen.structure;

import com.mojang.serialization.Codec;
import net.cr24.primeval.block.PrimevalBlocks;
import net.minecraft.block.BlockState;
import net.minecraft.structure.StructurePiecesCollector;
import net.minecraft.world.Heightmap;
import net.minecraft.world.gen.structure.Structure;
import net.minecraft.world.gen.structure.StructureType;

import java.util.Optional;

public class CassiteriteTinOreFieldStructure extends Structure {

public static final Codec<CassiteriteTinOreFieldStructure> CODEC = createCodec(CassiteriteTinOreFieldStructure::new);

public CassiteriteTinOreFieldStructure(Config config) {
super(config);
}

public Optional<StructurePosition> getStructurePosition(Structure.Context context) {
return getStructurePosition(context, Heightmap.Type.WORLD_SURFACE_WG, (collector) -> {
addPieces(collector, context);
});
}

private static void addPieces(StructurePiecesCollector collector, Structure.Context context) {
int height = context.random().nextBetween(-40, -22);
BlockState[] ores = new BlockState[] {
PrimevalBlocks.TIN_CASSITERITE_ORE.large().getDefaultState(),
PrimevalBlocks.TIN_CASSITERITE_ORE.medium().getDefaultState(),
PrimevalBlocks.TIN_CASSITERITE_ORE.small().getDefaultState(),
PrimevalBlocks.STONE.getDefaultState()
};
// Motherlode
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ(), height, 80, 7, 8, 9, 0.7f, ores));
// Inner ring
int innerRingRadius = 40;
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+innerRingRadius, context.chunkPos().getStartZ(), height, 60, 6, 3, 5, 0.8f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-innerRingRadius, context.chunkPos().getStartZ(), height, 60, 6, 3, 5, 0.8f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()+innerRingRadius, height, 60, 6, 3, 5, 0.8f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()-innerRingRadius, height, 60, 6, 3, 5, 0.8f, ores));
// Outer Ring
int outerRingRadius1 = 60;
int outerRingRadius2 = 48;
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius1, context.chunkPos().getStartZ(), height, 42, 5, 3, 4, 1.0f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius1, context.chunkPos().getStartZ(), height, 42, 5, 3, 4, 1.0f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()+outerRingRadius1, height, 42, 5, 3, 4, 1.0f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()-outerRingRadius1, height, 42, 5, 3, 4, 1.0f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius2, context.chunkPos().getStartZ()+outerRingRadius2, height, 35, 6, 3, 4, 1.3f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius2, context.chunkPos().getStartZ()+outerRingRadius2, height, 35, 6, 3, 4, 1.3f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius2, context.chunkPos().getStartZ()-outerRingRadius2, height, 35, 6, 3, 4, 1.3f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius2, context.chunkPos().getStartZ()-outerRingRadius2, height, 35, 6, 3, 4, 1.3f, ores));
}

public StructureType<?> getType() {
return PrimevalStructures.CASSITERITE_TIN_ORE_FIELD;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package net.cr24.primeval.world.gen.structure;

import com.mojang.serialization.Codec;
import net.cr24.primeval.block.PrimevalBlocks;
import net.minecraft.block.BlockState;
import net.minecraft.structure.StructurePiecesCollector;
import net.minecraft.world.Heightmap;
import net.minecraft.world.gen.structure.Structure;
import net.minecraft.world.gen.structure.StructureType;

import java.util.Optional;

public class LazuriteOreFieldStructure extends Structure {

public static final Codec<LazuriteOreFieldStructure> CODEC = createCodec(LazuriteOreFieldStructure::new);

public LazuriteOreFieldStructure(Config config) {
super(config);
}

public Optional<StructurePosition> getStructurePosition(Structure.Context context) {
return getStructurePosition(context, Heightmap.Type.WORLD_SURFACE_WG, (collector) -> {
addPieces(collector, context);
});
}

private static void addPieces(StructurePiecesCollector collector, Structure.Context context) {
int height = context.random().nextBetween(-80, -60);
BlockState[] ores = new BlockState[] {
PrimevalBlocks.LAZURITE_ORE.large().getDefaultState(),
PrimevalBlocks.LAZURITE_ORE.medium().getDefaultState(),
PrimevalBlocks.LAZURITE_ORE.small().getDefaultState(),
PrimevalBlocks.GOLD_NATIVE_ORE.small().getDefaultState()
};
// Motherlode
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ(), height, 45, 5, 5, 7, 0.45f, ores));
// Inner ring
int innerRingRadius = 36;
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+innerRingRadius, context.chunkPos().getStartZ(), height, 50, 4, 3, 5, 0.8f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-innerRingRadius, context.chunkPos().getStartZ(), height, 50, 4, 3, 5, 0.7f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()+innerRingRadius, height, 50, 4, 3, 5, 0.8f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()-innerRingRadius, height, 50, 4, 3, 5, 0.7f, ores));
// Outer Ring
int outerRingRadius1 = 72;
int outerRingRadius2 = 54;
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius1, context.chunkPos().getStartZ(), height, 55, 6, 3, 4, 0.9f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius1, context.chunkPos().getStartZ(), height, 55, 6, 3, 4, 1.0f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()+outerRingRadius1, height, 55, 6, 3, 4, 0.9f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()-outerRingRadius1, height, 55, 6, 3, 4, 1.0f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius2, context.chunkPos().getStartZ()+outerRingRadius2, height, 45, 5, 3, 4, 1.5f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius2, context.chunkPos().getStartZ()+outerRingRadius2, height, 45, 5, 3, 4, 1.5f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius2, context.chunkPos().getStartZ()-outerRingRadius2, height, 45, 5, 3, 4, 1.5f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius2, context.chunkPos().getStartZ()-outerRingRadius2, height, 45, 5, 3, 4, 1.5f, ores));
}

public StructureType<?> getType() {
return PrimevalStructures.LAZURITE_ORE_FIELD;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package net.cr24.primeval.world.gen.structure;

import com.mojang.serialization.Codec;
import net.cr24.primeval.block.PrimevalBlocks;
import net.minecraft.block.BlockState;
import net.minecraft.structure.StructurePiecesCollector;
import net.minecraft.world.Heightmap;
import net.minecraft.world.gen.structure.Structure;
import net.minecraft.world.gen.structure.StructureType;

import java.util.Optional;

public class MalachiteCopperOreFieldStructure extends Structure {

public static final Codec<MalachiteCopperOreFieldStructure> CODEC = createCodec(MalachiteCopperOreFieldStructure::new);

public MalachiteCopperOreFieldStructure(Config config) {
super(config);
}

public Optional<Structure.StructurePosition> getStructurePosition(Structure.Context context) {
return getStructurePosition(context, Heightmap.Type.WORLD_SURFACE_WG, (collector) -> {
addPieces(collector, context);
});
}

private static void addPieces(StructurePiecesCollector collector, Structure.Context context) {
int height = context.random().nextBetween(-50, -25);
BlockState[] ores = new BlockState[] {
PrimevalBlocks.COPPER_MALACHITE_ORE.large().getDefaultState(),
PrimevalBlocks.COPPER_MALACHITE_ORE.medium().getDefaultState(),
PrimevalBlocks.COPPER_MALACHITE_ORE.small().getDefaultState(),
PrimevalBlocks.STONE.getDefaultState()
};
// Motherlode
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ(), height, 70, 10, 5, 7, 0.3f, ores));
// Inner ring
int innerRingRadius = 26;
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+innerRingRadius, context.chunkPos().getStartZ(), height, 40, 7, 3, 5, 0.6f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-innerRingRadius, context.chunkPos().getStartZ(), height, 40, 7, 3, 5, 0.7f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()+innerRingRadius, height, 40, 7, 3, 5, 0.6f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()-innerRingRadius, height, 40, 7, 3, 5, 0.7f, ores));
// Outer Ring
int outerRingRadius1 = 54;
int outerRingRadius2 = 40;
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius1, context.chunkPos().getStartZ(), height, 40, 4, 3, 4, 0.9f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius1, context.chunkPos().getStartZ(), height, 40, 4, 3, 4, 0.9f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()+outerRingRadius1, height, 40, 4, 3, 4, 0.9f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()-outerRingRadius1, height, 40, 4, 3, 4, 0.9f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius2, context.chunkPos().getStartZ()+outerRingRadius2, height, 35, 5, 3, 4, 1.2f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius2, context.chunkPos().getStartZ()+outerRingRadius2, height, 35, 5, 3, 4, 1.2f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius2, context.chunkPos().getStartZ()-outerRingRadius2, height, 35, 5, 3, 4, 1.2f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius2, context.chunkPos().getStartZ()-outerRingRadius2, height, 35, 5, 3, 4, 1.2f, ores));
}

public StructureType<?> getType() {
return PrimevalStructures.MALACHITE_COPPER_ORE_FIELD;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package net.cr24.primeval.world.gen.structure;

import com.mojang.serialization.Codec;
import net.cr24.primeval.block.PrimevalBlocks;
import net.cr24.primeval.world.PrimevalWorld;
import net.minecraft.block.BlockState;
import net.minecraft.structure.StructurePiecesCollector;
import net.minecraft.world.Heightmap;
import net.minecraft.world.gen.structure.Structure;
import net.minecraft.world.gen.structure.StructureType;

import java.util.Optional;

public class NativeCopperOreFieldStructure extends Structure {

public static final Codec<NativeCopperOreFieldStructure> CODEC = createCodec(NativeCopperOreFieldStructure::new);

public NativeCopperOreFieldStructure(Config config) {
super(config);
}

public Optional<Structure.StructurePosition> getStructurePosition(Structure.Context context) {
return getStructurePosition(context, Heightmap.Type.WORLD_SURFACE_WG, (collector) -> {
addPieces(collector, context);
});
}

private static void addPieces(StructurePiecesCollector collector, Structure.Context context) {
int height;
height = context.random().nextBetween(-40, -10);
BlockState[] ores = new BlockState[] {
PrimevalBlocks.COPPER_NATIVE_ORE.large().getDefaultState(),
PrimevalBlocks.COPPER_NATIVE_ORE.medium().getDefaultState(),
PrimevalBlocks.COPPER_NATIVE_ORE.small().getDefaultState(),
PrimevalBlocks.STONE.getDefaultState()
};
// Motherlode
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ(), height, 60, 8, 7, 9, 0.5f, ores));
// Inner ring
int innerRingRadius = 32;
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+innerRingRadius, context.chunkPos().getStartZ(), height, 50, 6, 3, 6, 0.6f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-innerRingRadius, context.chunkPos().getStartZ(), height, 50, 6, 3, 6, 0.7f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()+innerRingRadius, height, 50, 6, 3, 6, 0.6f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()-innerRingRadius, height, 50, 6, 3, 6, 0.7f, ores));
// Outer Ring
int outerRingRadius1 = 60;
int outerRingRadius2 = 48;
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius1, context.chunkPos().getStartZ(), height, 42, 5, 3, 4, 0.9f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius1, context.chunkPos().getStartZ(), height, 42, 5, 3, 4, 0.9f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()+outerRingRadius1, height, 42, 5, 3, 4, 0.9f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX(), context.chunkPos().getStartZ()-outerRingRadius1, height, 42, 5, 3, 4, 0.9f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius2, context.chunkPos().getStartZ()+outerRingRadius2, height, 35, 6, 3, 4, 1.2f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius2, context.chunkPos().getStartZ()+outerRingRadius2, height, 35, 6, 3, 4, 1.2f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()+outerRingRadius2, context.chunkPos().getStartZ()-outerRingRadius2, height, 35, 6, 3, 4, 1.2f, ores));
collector.addPiece(new OreFieldGenerator.Blob(context.random(), context.chunkPos().getStartX()-outerRingRadius2, context.chunkPos().getStartZ()-outerRingRadius2, height, 35, 6, 3, 4, 1.2f, ores));
}

public StructureType<?> getType() {
return PrimevalStructures.NATIVE_COPPER_ORE_FIELD;
}
}
Loading

0 comments on commit 5d49d52

Please sign in to comment.