-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
511 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/main/java/net/cr24/primeval/world/gen/structure/CassiteriteTinOreFieldStructure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
src/main/java/net/cr24/primeval/world/gen/structure/LazuriteOreFieldStructure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
src/main/java/net/cr24/primeval/world/gen/structure/MalachiteCopperOreFieldStructure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
src/main/java/net/cr24/primeval/world/gen/structure/NativeCopperOreFieldStructure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.