feat: Add latitude-based world generation with extra-large biomes
- Custom BiomeSource distributes biomes by Z coordinate (north=cold, south=hot) - Extra-large biomes (~3000 blocks, 8x vanilla) - Underground biomes follow surface temperature logic - Always spawn in plains near Z=0 - Welcome message explaining latitude mechanics - Uses amplified noise settings for higher mountains - BOP biomes integrated in temperature bands - Selectable as 'Large Latitude' world type in world creation - New config section 'world_generation' - Version bumped to 2.2.0
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
.gradle/
|
||||
build/
|
||||
run/
|
||||
*.iml
|
||||
.idea/
|
||||
*.class
|
||||
*.log
|
||||
*.lock
|
||||
*.bin
|
||||
+1
-1
@@ -3,7 +3,7 @@ plugins {
|
||||
id 'net.minecraftforge.gradle' version '[6.0.16,6.2)'
|
||||
}
|
||||
|
||||
version = '2.1.12'
|
||||
version = '2.2.0'
|
||||
group = 'com.aulyrius.custom_ore_gen'
|
||||
archivesBaseName = 'custom_ore_gen'
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.mcreator.customoregen.init.CustomOreGenModTabs;
|
||||
import net.mcreator.customoregen.init.CustomOreGenModItems;
|
||||
import net.mcreator.customoregen.init.CustomOreGenModBlocks;
|
||||
import net.mcreator.customoregen.worldgen.WorldGenRegistration;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.function.Function;
|
||||
@@ -47,6 +48,8 @@ public class CustomOreGenMod {
|
||||
|
||||
CustomOreGenModTabs.REGISTRY.register(bus);
|
||||
|
||||
WorldGenRegistration.BIOME_SOURCES.register(bus);
|
||||
|
||||
// Start of user code block mod init
|
||||
// End of user code block mod init
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ public class ModConfigs {
|
||||
public static final ToolStatsConfig TOOL_STATS;
|
||||
public static final DropsConfig DROPS;
|
||||
public static final FeatureToggleConfig FEATURES;
|
||||
public static final WorldGenConfig WORLD_GEN;
|
||||
|
||||
static {
|
||||
BUILDER.push("Custom Ore Gem Configuration");
|
||||
@@ -18,6 +19,7 @@ public class ModConfigs {
|
||||
TOOL_STATS = new ToolStatsConfig(BUILDER);
|
||||
DROPS = new DropsConfig(BUILDER);
|
||||
FEATURES = new FeatureToggleConfig(BUILDER);
|
||||
WORLD_GEN = new WorldGenConfig(BUILDER);
|
||||
|
||||
BUILDER.pop();
|
||||
SPEC = BUILDER.build();
|
||||
@@ -327,4 +329,42 @@ public class ModConfigs {
|
||||
builder.pop();
|
||||
}
|
||||
}
|
||||
|
||||
public static class WorldGenConfig {
|
||||
public final ForgeConfigSpec.ConfigValue<Integer> biomeSize;
|
||||
public final ForgeConfigSpec.ConfigValue<Integer> temperatureBandWidth;
|
||||
public final ForgeConfigSpec.DoubleValue mountainHeightMultiplier;
|
||||
public final ForgeConfigSpec.ConfigValue<Boolean> enableBOPBiomes;
|
||||
public final ForgeConfigSpec.ConfigValue<Boolean> enableOceans;
|
||||
public final ForgeConfigSpec.ConfigValue<Boolean> enableWelcomeMessage;
|
||||
public final ForgeConfigSpec.ConfigValue<Integer> spawnSearchRadius;
|
||||
|
||||
public WorldGenConfig(ForgeConfigSpec.Builder builder) {
|
||||
builder.push("world_generation");
|
||||
|
||||
biomeSize = builder
|
||||
.comment("Individual biome size in blocks (default: 3000)")
|
||||
.defineInRange("biomeSize", 3000, 500, 20000);
|
||||
temperatureBandWidth = builder
|
||||
.comment("Width of each temperature band in blocks (default: 4000)")
|
||||
.defineInRange("temperatureBandWidth", 4000, 1000, 50000);
|
||||
mountainHeightMultiplier = builder
|
||||
.comment("Multiplier for mountain terrain height (1.0 = vanilla, default: 1.5)")
|
||||
.defineInRange("mountainHeightMultiplier", 1.5, 1.0, 3.0);
|
||||
enableBOPBiomes = builder
|
||||
.comment("Include Biomes O' Plenty biomes in temperature bands (default: true)")
|
||||
.define("enableBOPBiomes", true);
|
||||
enableOceans = builder
|
||||
.comment("Generate oceans by latitude band (default: true)")
|
||||
.define("enableOceans", true);
|
||||
enableWelcomeMessage = builder
|
||||
.comment("Show welcome message about latitude mechanics on first join (default: true)")
|
||||
.define("enableWelcomeMessage", true);
|
||||
spawnSearchRadius = builder
|
||||
.comment("Radius to search for plains biome at spawn (default: 100)")
|
||||
.defineInRange("spawnSearchRadius", 100, 10, 1000);
|
||||
|
||||
builder.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
package net.mcreator.customoregen.worldgen;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.Biomes;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum BiomeBand {
|
||||
FROZEN(-12000),
|
||||
COLD(-6000),
|
||||
COOL(-2000),
|
||||
TEMPERATE(0),
|
||||
WARM(6000),
|
||||
HOT(12000),
|
||||
EXTREME(12000);
|
||||
|
||||
public final int bandBoundary;
|
||||
|
||||
BiomeBand(int bandBoundary) {
|
||||
this.bandBoundary = bandBoundary;
|
||||
}
|
||||
|
||||
public static List<Holder<Biome>> oceanFor(double temperature) {
|
||||
int band = (int) Math.round(temperature);
|
||||
List<ResourceKey<Biome>> keys = new ArrayList<>();
|
||||
if (band <= -2) {
|
||||
keys.add(Biomes.FROZEN_OCEAN);
|
||||
keys.add(Biomes.DEEP_FROZEN_OCEAN);
|
||||
} else if (band == -1) {
|
||||
keys.add(Biomes.COLD_OCEAN);
|
||||
keys.add(Biomes.DEEP_COLD_OCEAN);
|
||||
} else if (band == 0) {
|
||||
keys.add(Biomes.OCEAN);
|
||||
keys.add(Biomes.DEEP_OCEAN);
|
||||
keys.add(Biomes.LUKEWARM_OCEAN);
|
||||
} else if (band == 1) {
|
||||
keys.add(Biomes.LUKEWARM_OCEAN);
|
||||
keys.add(Biomes.DEEP_LUKEWARM_OCEAN);
|
||||
} else {
|
||||
keys.add(Biomes.WARM_OCEAN);
|
||||
}
|
||||
return resolveHolders(keys);
|
||||
}
|
||||
|
||||
public static List<Holder<Biome>> undergroundFor(double temperature) {
|
||||
int band = (int) Math.round(temperature);
|
||||
List<ResourceKey<Biome>> keys = new ArrayList<>();
|
||||
if (band <= -1) {
|
||||
keys.add(Biomes.DRIPSTONE_CAVES);
|
||||
} else if (band == 0) {
|
||||
keys.add(Biomes.LUSH_CAVES);
|
||||
} else {
|
||||
keys.add(Biomes.LUSH_CAVES);
|
||||
keys.add(Biomes.DRIPSTONE_CAVES);
|
||||
}
|
||||
return resolveHolders(keys);
|
||||
}
|
||||
|
||||
public List<Holder<Biome>> surface() {
|
||||
List<ResourceKey<Biome>> keys = new ArrayList<>();
|
||||
switch (this) {
|
||||
case FROZEN:
|
||||
add(keys, Biomes.ICE_SPIKES, Biomes.SNOWY_PLAINS, Biomes.SNOWY_BEACH,
|
||||
Biomes.FROZEN_RIVER, Biomes.SNOWY_SLOPES, Biomes.DRIPSTONE_CAVES,
|
||||
Biomes.DEEP_DARK);
|
||||
addBOP(keys, "auroral_garden", "cold_desert", "tundra", "snowblossom_grove",
|
||||
"snowy_coniferous_forest", "snowy_fir_clearing", "snowy_maple_woods");
|
||||
break;
|
||||
case COLD:
|
||||
add(keys, Biomes.SNOWY_TAIGA, Biomes.GROVE, Biomes.SNOWY_BEACH,
|
||||
Biomes.SNOWY_SLOPES, Biomes.OLD_GROWTH_PINE_TAIGA,
|
||||
Biomes.FROZEN_PEAKS, Biomes.JAGGED_PEAKS, Biomes.ICE_SPIKES);
|
||||
addBOP(keys, "snowy_coniferous_forest", "snowy_fir_clearing",
|
||||
"snowy_maple_woods", "snowblossom_grove", "cold_desert", "tundra");
|
||||
break;
|
||||
case COOL:
|
||||
add(keys, Biomes.OLD_GROWTH_PINE_TAIGA, Biomes.OLD_GROWTH_SPRUCE_TAIGA,
|
||||
Biomes.TAIGA, Biomes.WINDSWEPT_FOREST, Biomes.STONY_SHORE,
|
||||
Biomes.WINDSWEPT_HILLS, Biomes.STONY_PEAKS,
|
||||
Biomes.DRIPSTONE_CAVES);
|
||||
addBOP(keys, "coniferous_forest", "fir_clearing", "dead_forest", "bog",
|
||||
"muskeg", "old_growth_dead_forest", "highland");
|
||||
break;
|
||||
case TEMPERATE:
|
||||
add(keys, Biomes.PLAINS, Biomes.SUNFLOWER_PLAINS, Biomes.FOREST,
|
||||
Biomes.BIRCH_FOREST, Biomes.FLOWER_FOREST, Biomes.MEADOW,
|
||||
Biomes.SWAMP, Biomes.BEACH, Biomes.RIVER, Biomes.CHERRY_GROVE,
|
||||
Biomes.OLD_GROWTH_BIRCH_FOREST, Biomes.LUSH_CAVES);
|
||||
addBOP(keys, "grassland", "prairie", "field", "shrubland", "woodland",
|
||||
"old_growth_woodland", "marsh", "seasonal_forest", "orchard",
|
||||
"rainbow_hills", "clover_patch", "origin_valley");
|
||||
break;
|
||||
case WARM:
|
||||
add(keys, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.SPARSE_JUNGLE,
|
||||
Biomes.WINDSWEPT_SAVANNA, Biomes.FOREST, Biomes.STONY_PEAKS,
|
||||
Biomes.MANGROVE_SWAMP, Biomes.LUSH_CAVES);
|
||||
addBOP(keys, "dryland", "mediterranean_forest", "prairie", "lavender_field",
|
||||
"lavender_forest", "orchard", "pasture", "scrubland",
|
||||
"rocky_shrubland", "floodplain", "rainforest", "rocky_rainforest");
|
||||
break;
|
||||
case HOT:
|
||||
add(keys, Biomes.DESERT, Biomes.JUNGLE, Biomes.BAMBOO_JUNGLE,
|
||||
Biomes.BADLANDS, Biomes.WOODED_BADLANDS, Biomes.ERODED_BADLANDS,
|
||||
Biomes.SAVANNA, Biomes.LUSH_CAVES, Biomes.DRIPSTONE_CAVES);
|
||||
addBOP(keys, "lush_desert", "lush_savanna", "fungal_jungle", "tropics",
|
||||
"bayou", "volcanic_plains", "wasteland", "outback",
|
||||
"oasis", "rainforest", "rocky_rainforest", "jade_cliffs");
|
||||
break;
|
||||
case EXTREME:
|
||||
add(keys, Biomes.ERODED_BADLANDS, Biomes.WOODED_BADLANDS,
|
||||
Biomes.BADLANDS, Biomes.DESERT, Biomes.MANGROVE_SWAMP,
|
||||
Biomes.WARM_OCEAN);
|
||||
addBOP(keys, "volcano", "erupting_inferno", "wasteland",
|
||||
"wasteland_steppe", "dryland", "lush_desert");
|
||||
break;
|
||||
}
|
||||
return resolveHolders(keys);
|
||||
}
|
||||
|
||||
private static void add(List<ResourceKey<Biome>> list, ResourceKey<Biome>... biomes) {
|
||||
for (ResourceKey<Biome> key : biomes) {
|
||||
list.add(key);
|
||||
}
|
||||
}
|
||||
|
||||
private static void addBOP(List<ResourceKey<Biome>> list, String... ids) {
|
||||
for (String id : ids) {
|
||||
ResourceKey<Biome> key = ResourceKey.create(Registries.BIOME,
|
||||
new ResourceLocation("biomesoplenty", id));
|
||||
if (ForgeRegistries.BIOMES.containsKey(key.location())) {
|
||||
list.add(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static List<Holder<Biome>> resolveHolders(List<ResourceKey<Biome>> keys) {
|
||||
List<Holder<Biome>> holders = new ArrayList<>();
|
||||
for (ResourceKey<Biome> key : keys) {
|
||||
ForgeRegistries.BIOMES.getHolder(key).ifPresent(holders::add);
|
||||
}
|
||||
return holders;
|
||||
}
|
||||
|
||||
public static List<Holder<Biome>> allPossible() {
|
||||
List<Holder<Biome>> all = new ArrayList<>();
|
||||
for (BiomeBand band : values()) {
|
||||
all.addAll(band.surface());
|
||||
}
|
||||
for (int t = -3; t <= 3; t++) {
|
||||
all.addAll(oceanFor(t));
|
||||
all.addAll(undergroundFor(t));
|
||||
}
|
||||
return all;
|
||||
}
|
||||
|
||||
public static double getTemperatureAtZ(int blockZ, net.minecraft.world.level.levelgen.synth.ImprovedNoise noise) {
|
||||
double raw = blockZ / 4000.0;
|
||||
double noiseVal = noise.noise(blockZ * 0.00033, 0, 0) * 0.8;
|
||||
return Math.max(-3.0, Math.min(3.0, raw + noiseVal));
|
||||
}
|
||||
|
||||
public static double getMoistureAtX(int blockX, int blockZ, net.minecraft.world.level.levelgen.synth.ImprovedNoise noise) {
|
||||
return noise.noise(blockX * 0.00025, blockZ * 0.00015, 0) * 0.5 + 0.5;
|
||||
}
|
||||
|
||||
public static boolean isOceanAt(int blockX, int blockZ, double temperature, net.minecraft.world.level.levelgen.synth.ImprovedNoise oceanNoise) {
|
||||
double oceanChance = oceanNoise.noise(blockX * 0.0001, blockZ * 0.0001, 0) * 0.5 + 0.5;
|
||||
double bandFactor = Math.abs(temperature) / 3.0;
|
||||
return oceanChance < 0.15 + bandFactor * 0.15;
|
||||
}
|
||||
|
||||
public static BiomeBand fromTemperature(double temperature) {
|
||||
int idx = (int) Math.round(temperature) + 3;
|
||||
idx = Math.max(0, Math.min(values().length - 1, idx));
|
||||
return values()[idx];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package net.mcreator.customoregen.worldgen;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import com.mojang.serialization.MapCodec;
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeSource;
|
||||
import net.minecraft.world.level.biome.Climate;
|
||||
import net.minecraft.world.level.levelgen.synth.ImprovedNoise;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class LatitudeBiomeSource extends BiomeSource {
|
||||
|
||||
public static final MapCodec<LatitudeBiomeSource> MAP_CODEC = RecordCodecBuilder.mapCodec(
|
||||
instance -> instance.group(
|
||||
Codec.LONG.fieldOf("seed").forGetter(src -> src.seed)
|
||||
).apply(instance, LatitudeBiomeSource::new)
|
||||
);
|
||||
|
||||
public static final Codec<LatitudeBiomeSource> CODEC = MAP_CODEC.codec();
|
||||
|
||||
private final long seed;
|
||||
private final ImprovedNoise temperatureNoise;
|
||||
private final ImprovedNoise moistureNoise;
|
||||
private final ImprovedNoise oceanNoise;
|
||||
private final ImprovedNoise biomeSelectorNoise;
|
||||
private final List<Holder<Biome>> possibleBiomes;
|
||||
|
||||
public LatitudeBiomeSource(long seed) {
|
||||
this.seed = seed;
|
||||
RandomSource rng = RandomSource.create(seed);
|
||||
this.temperatureNoise = new ImprovedNoise(rng);
|
||||
this.moistureNoise = new ImprovedNoise(rng);
|
||||
this.oceanNoise = new ImprovedNoise(rng);
|
||||
this.biomeSelectorNoise = new ImprovedNoise(rng);
|
||||
this.possibleBiomes = BiomeBand.allPossible();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Codec<? extends BiomeSource> codec() {
|
||||
return CODEC;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Stream<Holder<Biome>> collectPossibleBiomes() {
|
||||
return possibleBiomes.stream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Holder<Biome> getNoiseBiome(int quartX, int quartY, int quartZ, Climate.Sampler sampler) {
|
||||
int blockX = quartX * 4;
|
||||
int blockZ = quartZ * 4;
|
||||
int blockY = quartY * 4;
|
||||
|
||||
double temperature = BiomeBand.getTemperatureAtZ(blockZ, temperatureNoise);
|
||||
double moisture = BiomeBand.getMoistureAtX(blockX, blockZ, moistureNoise);
|
||||
|
||||
if (BiomeBand.isOceanAt(blockX, blockZ, temperature, oceanNoise)) {
|
||||
List<Holder<Biome>> oceans = BiomeBand.oceanFor(temperature);
|
||||
double pick = biomeSelectorNoise.noise(blockX * 0.005, blockZ * 0.005, 1000);
|
||||
int idx = (int) ((pick * 0.5 + 0.5) * oceans.size());
|
||||
return oceans.get(Math.max(0, Math.min(oceans.size() - 1, idx)));
|
||||
}
|
||||
|
||||
if (blockY < 0) {
|
||||
List<Holder<Biome>> underground = BiomeBand.undergroundFor(temperature);
|
||||
double pick = biomeSelectorNoise.noise(blockX * 0.01, blockZ * 0.01, 2000);
|
||||
int idx = (int) ((pick * 0.5 + 0.5) * underground.size());
|
||||
return underground.get(Math.max(0, Math.min(underground.size() - 1, idx)));
|
||||
}
|
||||
|
||||
BiomeBand band = BiomeBand.fromTemperature(temperature);
|
||||
List<Holder<Biome>> biomes = band.surface();
|
||||
if (biomes.isEmpty()) {
|
||||
biomes = BiomeBand.TEMPERATE.surface();
|
||||
}
|
||||
|
||||
double pick = biomeSelectorNoise.noise(blockX * 0.0008, blockZ * 0.0008, 3000);
|
||||
double adjusted = pick * 0.5 + moisture * 0.3;
|
||||
int idx = (int) ((adjusted * 0.5 + 0.5) * biomes.size());
|
||||
return biomes.get(Math.max(0, Math.min(biomes.size() - 1, idx)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package net.mcreator.customoregen.worldgen;
|
||||
|
||||
import net.mcreator.customoregen.CustomOreGenMod;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.level.biome.Biomes;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
import net.minecraftforge.event.entity.EntityJoinLevelEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = CustomOreGenMod.MODID)
|
||||
public class PlainsSpawnHandler {
|
||||
|
||||
private static boolean hasSetSpawn = false;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onPlayerJoin(EntityJoinLevelEvent event) {
|
||||
if (hasSetSpawn) return;
|
||||
if (!(event.getEntity() instanceof Player player)) return;
|
||||
if (!(event.getLevel() instanceof ServerLevel level)) return;
|
||||
if (!level.dimensionType().natural()) return;
|
||||
|
||||
hasSetSpawn = true;
|
||||
|
||||
if (level.getSharedSpawnPos().getX() != 0 || level.getSharedSpawnPos().getZ() != 0) return;
|
||||
|
||||
BlockPos spawn = findPlainsSpawn(level);
|
||||
level.setDefaultSpawnPos(spawn, 0.0f);
|
||||
CustomOreGenMod.LOGGER.info("Custom Ore Gen: Spawn set to plains at {}", spawn);
|
||||
}
|
||||
|
||||
private static BlockPos findPlainsSpawn(ServerLevel level) {
|
||||
int radius = 100;
|
||||
BlockPos bestPos = new BlockPos(0, 64, 0);
|
||||
double bestDistance = Double.MAX_VALUE;
|
||||
|
||||
for (int x = -radius; x <= radius; x += 4) {
|
||||
for (int z = -radius; z <= radius; z += 4) {
|
||||
BlockPos pos = new BlockPos(x, 0, z);
|
||||
var biome = level.getBiome(pos);
|
||||
if (biome.is(Biomes.PLAINS) || biome.is(Biomes.SUNFLOWER_PLAINS)) {
|
||||
double dist = Math.sqrt(x * x + z * z);
|
||||
if (dist < bestDistance) {
|
||||
bestDistance = dist;
|
||||
int y = level.getHeight(Heightmap.Types.WORLD_SURFACE, x, z);
|
||||
bestPos = new BlockPos(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return bestPos;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package net.mcreator.customoregen.worldgen;
|
||||
|
||||
import net.mcreator.customoregen.CustomOreGenMod;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraftforge.event.entity.EntityJoinLevelEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = CustomOreGenMod.MODID)
|
||||
public class WelcomeMessageHandler {
|
||||
|
||||
private static boolean hasShownMessage = false;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onPlayerJoin(EntityJoinLevelEvent event) {
|
||||
if (hasShownMessage) return;
|
||||
if (!(event.getEntity() instanceof Player player)) return;
|
||||
if (!(event.getLevel() instanceof ServerLevel level)) return;
|
||||
|
||||
hasShownMessage = true;
|
||||
|
||||
ChunkGenerator generator = level.getChunkSource().getGenerator();
|
||||
if (!(generator.getBiomeSource() instanceof LatitudeBiomeSource)) return;
|
||||
|
||||
player.sendSystemMessage(Component.literal(""));
|
||||
player.sendSystemMessage(Component.literal("\u00A76\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"));
|
||||
player.sendSystemMessage(Component.literal("\u00A7e Custom Ore Gen \u00BB Mode Latitude"));
|
||||
player.sendSystemMessage(Component.literal("\u00A76\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"));
|
||||
player.sendSystemMessage(Component.literal("\u00A77 Le monde suit une logique de latitude !"));
|
||||
player.sendSystemMessage(Component.literal("\u00A7b Nord (Z \u2192 -) \u00A73\u2192 Landes enneig\u00E9es & ta\u00EFgas"));
|
||||
player.sendSystemMessage(Component.literal("\u00A7a Centre \u00A72\u2192 Plaines, for\u00EAts temp\u00E9r\u00E9es \u00A78[SPAWN]"));
|
||||
player.sendSystemMessage(Component.literal("\u00A7c Sud (Z \u2192 +) \u00A76\u2192 D\u00E9serts, jungles & savanes"));
|
||||
player.sendSystemMessage(Component.literal("\u00A77 Les grottes suivent la m\u00EAme logique."));
|
||||
player.sendSystemMessage(Component.literal("\u00A7e Astuce : F3 pour voir vos coordonn\u00E9es Z"));
|
||||
player.sendSystemMessage(Component.literal("\u00A76\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package net.mcreator.customoregen.worldgen;
|
||||
|
||||
import net.mcreator.customoregen.CustomOreGenMod;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.world.level.biome.BiomeSource;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
import com.mojang.serialization.Codec;
|
||||
|
||||
public class WorldGenRegistration {
|
||||
public static final DeferredRegister<Codec<? extends BiomeSource>> BIOME_SOURCES =
|
||||
DeferredRegister.create(Registries.BIOME_SOURCE, CustomOreGenMod.MODID);
|
||||
|
||||
public static final RegistryObject<Codec<? extends BiomeSource>> LATITUDE =
|
||||
BIOME_SOURCES.register("latitude", () -> LatitudeBiomeSource.CODEC);
|
||||
}
|
||||
@@ -4,12 +4,12 @@ license="Not specified"
|
||||
|
||||
[[mods]]
|
||||
modId="custom_ore_gen"
|
||||
version="2.1.6-forge"
|
||||
version="2.2.0-forge"
|
||||
displayName="Custom Ore Gen"
|
||||
displayURL="https://lanro.eu"
|
||||
credits="Created using mod maker MCreator - https://mcreator.net/about"
|
||||
authors="Aulyrius cr\u00E9e via MCreator"
|
||||
description="Changement de la distribution des ressources sur Minecraft, ne pas utilis\u00E9 seul sans KubeJS"
|
||||
description="Changement de la distribution des ressources. Monde latitude extra-large avec biomes r\u00E9partis par Z (nord=froid, sud=chaud), montagnes amplifi\u00E9es, grottes suivent la surface. Ne pas utiliser seul sans KubeJS."
|
||||
|
||||
# Start of user code block mod configuration
|
||||
# End of user code block mod configuration
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"dimensions": {
|
||||
"minecraft:overworld": {
|
||||
"type": "minecraft:overworld",
|
||||
"generator": {
|
||||
"type": "minecraft:noise",
|
||||
"biome_source": {
|
||||
"type": "custom_ore_gen:latitude",
|
||||
"seed": 0
|
||||
},
|
||||
"settings": "minecraft:amplified"
|
||||
}
|
||||
},
|
||||
"minecraft:the_nether": {
|
||||
"type": "minecraft:the_nether",
|
||||
"generator": {
|
||||
"type": "minecraft:noise",
|
||||
"biome_source": {
|
||||
"type": "minecraft:multi_noise",
|
||||
"preset": "minecraft:nether"
|
||||
},
|
||||
"settings": "minecraft:nether"
|
||||
}
|
||||
},
|
||||
"minecraft:the_end": {
|
||||
"type": "minecraft:the_end",
|
||||
"generator": {
|
||||
"type": "minecraft:noise",
|
||||
"biome_source": {
|
||||
"type": "minecraft:the_end"
|
||||
},
|
||||
"settings": "minecraft:end"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user