[Change] Removed SurfaceRuleRegistry and BCLChunkGenerator

This commit is contained in:
Frank 2023-09-12 13:45:13 +02:00
parent 6be4140d7e
commit 3973a1a78f
43 changed files with 52 additions and 2012 deletions

View file

@ -1,737 +0,0 @@
{
"aquifers_enabled": false,
"default_block": {
"Name": "minecraft:netherrack"
},
"default_fluid": {
"Name": "minecraft:lava",
"Properties": {
"level": "0"
}
},
"disable_mob_generation": false,
"legacy_random_source": true,
"noise": {
"height": 256,
"min_y": 0,
"size_horizontal": 1,
"size_vertical": 4
},
"noise_router": {
"barrier": 0.0,
"continents": 0.0,
"depth": 0.0,
"erosion": 0.0,
"final_density": {
"type": "minecraft:squeeze",
"argument": {
"type": "minecraft:mul",
"argument1": 0.64,
"argument2": {
"type": "minecraft:interpolated",
"argument": {
"type": "minecraft:blend_density",
"argument": {
"type": "minecraft:add",
"argument1": 2.5,
"argument2": {
"type": "minecraft:mul",
"argument1": {
"type": "minecraft:y_clamped_gradient",
"from_value": 0.0,
"from_y": -8,
"to_value": 1.0,
"to_y": 24
},
"argument2": {
"type": "minecraft:add",
"argument1": -2.5,
"argument2": {
"type": "minecraft:add",
"argument1": 0.9375,
"argument2": {
"type": "minecraft:mul",
"argument1": {
"type": "minecraft:y_clamped_gradient",
"from_value": 1.0,
"from_y": 232,
"to_value": 0.0,
"to_y": 256
},
"argument2": {
"type": "minecraft:add",
"argument1": -0.9375,
"argument2": "minecraft:nether/base_3d_noise"
}
}
}
}
}
}
}
}
}
},
"fluid_level_floodedness": 0.0,
"fluid_level_spread": 0.0,
"initial_density_without_jaggedness": 0.0,
"lava": 0.0,
"ridges": 0.0,
"temperature": {
"type": "minecraft:shifted_noise",
"noise": "minecraft:temperature",
"shift_x": "minecraft:shift_x",
"shift_y": 0.0,
"shift_z": "minecraft:shift_z",
"xz_scale": 0.25,
"y_scale": 0.0
},
"vegetation": {
"type": "minecraft:shifted_noise",
"noise": "minecraft:vegetation",
"shift_x": "minecraft:shift_x",
"shift_y": 0.0,
"shift_z": "minecraft:shift_z",
"xz_scale": 0.25,
"y_scale": 0.0
},
"vein_gap": 0.0,
"vein_ridged": 0.0,
"vein_toggle": 0.0
},
"ore_veins_enabled": false,
"sea_level": 32,
"spawn_target": [],
"surface_rule": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:vertical_gradient",
"false_at_and_above": {
"above_bottom": 5
},
"random_name": "minecraft:bedrock_floor",
"true_at_and_below": {
"above_bottom": 0
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:bedrock"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:vertical_gradient",
"false_at_and_above": {
"below_top": 0
},
"random_name": "minecraft:bedrock_roof",
"true_at_and_below": {
"below_top": 5
}
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:bedrock"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"add_stone_depth": false,
"anchor": {
"below_top": 5
},
"surface_depth_multiplier": 0
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:netherrack"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"minecraft:basalt_deltas"
]
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": true,
"offset": 0,
"secondary_depth_range": 0,
"surface_type": "ceiling"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:basalt",
"Properties": {
"axis": "y"
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": true,
"offset": 0,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": -0.012,
"noise": "minecraft:patch"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"add_stone_depth": true,
"anchor": {
"absolute": 30
},
"surface_depth_multiplier": 0
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:y_above",
"add_stone_depth": true,
"anchor": {
"absolute": 35
},
"surface_depth_multiplier": 0
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:gravel"
}
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": 0.0,
"noise": "minecraft:nether_state_selector"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:basalt",
"Properties": {
"axis": "y"
}
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:blackstone"
}
}
]
}
}
]
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"minecraft:soul_sand_valley"
]
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": true,
"offset": 0,
"secondary_depth_range": 0,
"surface_type": "ceiling"
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": 0.0,
"noise": "minecraft:nether_state_selector"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:soul_sand"
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:soul_soil"
}
}
]
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": true,
"offset": 0,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": -0.012,
"noise": "minecraft:patch"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"add_stone_depth": true,
"anchor": {
"absolute": 30
},
"surface_depth_multiplier": 0
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:y_above",
"add_stone_depth": true,
"anchor": {
"absolute": 35
},
"surface_depth_multiplier": 0
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:gravel"
}
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": 0.0,
"noise": "minecraft:nether_state_selector"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:soul_sand"
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:soul_soil"
}
}
]
}
}
]
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 0,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:y_above",
"add_stone_depth": false,
"anchor": {
"absolute": 32
},
"surface_depth_multiplier": 0
}
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:hole"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:lava",
"Properties": {
"level": "0"
}
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"minecraft:warped_forest"
]
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": 0.54,
"noise": "minecraft:netherrack"
}
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"add_stone_depth": false,
"anchor": {
"absolute": 31
},
"surface_depth_multiplier": 0
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": 1.17,
"noise": "minecraft:nether_wart"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:warped_wart_block"
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:warped_nylium"
}
}
]
}
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"minecraft:crimson_forest"
]
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": 0.54,
"noise": "minecraft:netherrack"
}
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"add_stone_depth": false,
"anchor": {
"absolute": 31
},
"surface_depth_multiplier": 0
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": 1.17,
"noise": "minecraft:nether_wart"
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:nether_wart_block"
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:crimson_nylium"
}
}
]
}
}
}
}
]
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:biome",
"biome_is": [
"minecraft:nether_wastes"
]
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": true,
"offset": 0,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": -0.012,
"noise": "minecraft:soul_sand_layer"
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:hole"
}
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"add_stone_depth": true,
"anchor": {
"absolute": 30
},
"surface_depth_multiplier": 0
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:y_above",
"add_stone_depth": true,
"anchor": {
"absolute": 35
},
"surface_depth_multiplier": 0
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:soul_sand"
}
}
}
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:netherrack"
}
}
]
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:stone_depth",
"add_surface_depth": false,
"offset": 0,
"secondary_depth_range": 0,
"surface_type": "floor"
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"add_stone_depth": false,
"anchor": {
"absolute": 31
},
"surface_depth_multiplier": 0
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:y_above",
"add_stone_depth": true,
"anchor": {
"absolute": 35
},
"surface_depth_multiplier": 0
}
},
"then_run": {
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:noise_threshold",
"max_threshold": 1.7976931348623157E308,
"min_threshold": -0.012,
"noise": "minecraft:gravel_layer"
},
"then_run": {
"type": "minecraft:sequence",
"sequence": [
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:y_above",
"add_stone_depth": false,
"anchor": {
"absolute": 32
},
"surface_depth_multiplier": 0
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:gravel"
}
}
},
{
"type": "minecraft:condition",
"if_true": {
"type": "minecraft:not",
"invert": {
"type": "minecraft:hole"
}
},
"then_run": {
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:gravel"
}
}
}
]
}
}
}
}
}
]
}
},
{
"type": "minecraft:block",
"result_state": {
"Name": "minecraft:netherrack"
}
}
]
}
}

View file

@ -1,208 +0,0 @@
package org.betterx.bclib.api.v2.generator;
import org.betterx.bclib.BCLib;
import org.betterx.bclib.api.v2.levelgen.LevelGenUtil;
import org.betterx.bclib.interfaces.NoiseGeneratorSettingsProvider;
import org.betterx.bclib.mixin.common.ChunkGeneratorAccessor;
import org.betterx.worlds.together.WorldsTogether;
import org.betterx.worlds.together.biomesource.MergeableBiomeSource;
import org.betterx.worlds.together.biomesource.ReloadableBiomeSource;
import org.betterx.worlds.together.chunkgenerator.EnforceableChunkGenerator;
import org.betterx.worlds.together.chunkgenerator.InjectableSurfaceRules;
import org.betterx.worlds.together.chunkgenerator.RestorableBiomeSource;
import org.betterx.worlds.together.world.BiomeSourceWithNoiseRelatedSettings;
import com.mojang.datafixers.DSL;
import com.mojang.datafixers.types.templates.TypeTemplate;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderGetter;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.data.worldgen.SurfaceRuleData;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.BiomeGenerationSettings;
import net.minecraft.world.level.biome.BiomeSource;
import net.minecraft.world.level.biome.FeatureSorter;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.dimension.DimensionType;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.levelgen.*;
import com.google.common.base.Suppliers;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.function.Supplier;
public class BCLChunkGenerator extends NoiseBasedChunkGenerator implements RestorableBiomeSource<BCLChunkGenerator>, InjectableSurfaceRules<BCLChunkGenerator>, EnforceableChunkGenerator<BCLChunkGenerator> {
public static final Codec<BCLChunkGenerator> CODEC = RecordCodecBuilder
.create((RecordCodecBuilder.Instance<BCLChunkGenerator> builderInstance) -> {
RecordCodecBuilder<BCLChunkGenerator, BiomeSource> biomeSourceCodec = BiomeSource.CODEC
.fieldOf("biome_source")
.forGetter((BCLChunkGenerator generator) -> generator.biomeSource);
RecordCodecBuilder<BCLChunkGenerator, Holder<NoiseGeneratorSettings>> settingsCodec = NoiseGeneratorSettings.CODEC
.fieldOf("settings")
.forGetter((BCLChunkGenerator generator) -> generator.generatorSettings());
return builderInstance.group(biomeSourceCodec, settingsCodec)
.apply(builderInstance, builderInstance.stable(BCLChunkGenerator::new));
});
protected static final NoiseSettings NETHER_NOISE_SETTINGS_AMPLIFIED = NoiseSettings.create(0, 256, 1, 4);
public static final ResourceKey<NoiseGeneratorSettings> AMPLIFIED_NETHER = ResourceKey.create(
Registries.NOISE_SETTINGS,
BCLib.makeID("amplified_nether")
);
public final BiomeSource initialBiomeSource;
public BCLChunkGenerator(
BiomeSource biomeSource,
Holder<NoiseGeneratorSettings> holder
) {
super(biomeSource, holder);
initialBiomeSource = biomeSource;
if (biomeSource instanceof BiomeSourceWithNoiseRelatedSettings bcl && holder.isBound()) {
bcl.onLoadGeneratorSettings(holder.value());
}
if (WorldsTogether.RUNS_TERRABLENDER) {
BCLib.LOGGER.info("Make sure features are loaded from terrablender:" + biomeSource.getClass().getName());
//terrablender is invalidating the feature initialization
//we redo it at this point, otherwise we will get blank biomes
rebuildFeaturesPerStep(biomeSource);
}
}
private void rebuildFeaturesPerStep(BiomeSource biomeSource) {
if (this instanceof ChunkGeneratorAccessor acc) {
Function<Holder<Biome>, BiomeGenerationSettings> function = (Holder<Biome> hh) -> hh.value()
.getGenerationSettings();
acc.bcl_setFeaturesPerStep(Suppliers.memoize(() -> FeatureSorter.buildFeaturesPerStep(
List.copyOf(biomeSource.possibleBiomes()),
(hh) -> function.apply(hh).features(),
true
)));
}
}
/**
* Other Mods like TerraBlender might inject new BiomeSources. We undo that change after the world setup did run.
*
* @param dimensionKey The Dimension where this ChunkGenerator is used from
*/
@Override
public void restoreInitialBiomeSource(ResourceKey<LevelStem> dimensionKey) {
if (initialBiomeSource != getBiomeSource()) {
if (this instanceof ChunkGeneratorAccessor acc) {
if (initialBiomeSource instanceof MergeableBiomeSource bs) {
acc.bcl_setBiomeSource(bs.mergeWithBiomeSource(getBiomeSource()));
} else if (initialBiomeSource instanceof ReloadableBiomeSource bs) {
bs.reloadBiomes();
}
rebuildFeaturesPerStep(getBiomeSource());
}
}
}
@Override
protected Codec<? extends ChunkGenerator> codec() {
return CODEC;
}
@Override
public String toString() {
return "BCLib - Chunk Generator (" + Integer.toHexString(hashCode()) + ")";
}
// This method is injected by Terrablender.
// We make sure terrablender does not rewrite the feature-set for our ChunkGenerator by overwriting the
// Mixin-Method with an empty implementation
public void appendFeaturesPerStep() {
}
@Override
public Registry<LevelStem> enforceGeneratorInWorldGenSettings(
RegistryAccess access,
ResourceKey<LevelStem> dimensionKey,
ResourceKey<DimensionType> dimensionTypeKey,
ChunkGenerator loadedChunkGenerator,
Registry<LevelStem> dimensionRegistry
) {
BCLib.LOGGER.info("Enforcing Correct Generator for " + dimensionKey.location().toString() + ".");
ChunkGenerator referenceGenerator = this;
if (loadedChunkGenerator instanceof org.betterx.bclib.interfaces.ChunkGeneratorAccessor generator) {
if (loadedChunkGenerator instanceof NoiseGeneratorSettingsProvider noiseProvider) {
if (referenceGenerator instanceof NoiseGeneratorSettingsProvider referenceProvider) {
final BiomeSource bs;
if (referenceGenerator.getBiomeSource() instanceof MergeableBiomeSource mbs) {
bs = mbs.mergeWithBiomeSource(loadedChunkGenerator.getBiomeSource());
} else {
bs = referenceGenerator.getBiomeSource();
}
referenceProvider.bclib_getNoiseGeneratorSettingHolders();
referenceGenerator = new BCLChunkGenerator(
bs,
noiseProvider.bclib_getNoiseGeneratorSettingHolders()
);
}
}
}
return LevelGenUtil.replaceGenerator(
dimensionKey,
dimensionTypeKey,
access,
dimensionRegistry,
referenceGenerator
);
}
public static NoiseGeneratorSettings amplifiedNether(BootstapContext<NoiseGeneratorSettings> bootstapContext) {
HolderGetter<DensityFunction> densityGetter = bootstapContext.lookup(Registries.DENSITY_FUNCTION);
return new NoiseGeneratorSettings(
NETHER_NOISE_SETTINGS_AMPLIFIED,
Blocks.NETHERRACK.defaultBlockState(),
Blocks.LAVA.defaultBlockState(),
NoiseRouterData.noNewCaves(
densityGetter,
bootstapContext.lookup(Registries.NOISE),
NoiseRouterData.slideNetherLike(densityGetter, 0, 256)
),
SurfaceRuleData.nether(),
List.of(),
32,
false,
false,
false,
true
);
}
public static Map<String, Supplier<TypeTemplate>> addGeneratorDSL(Map<String, Supplier<TypeTemplate>> map) {
if (map.containsKey("minecraft:flat")) {
Map<String, Supplier<TypeTemplate>> nMap = new HashMap<>(map);
nMap.put("bclib:betterx", DSL::remainder);
return nMap;
}
return map;
}
}

View file

@ -1,111 +0,0 @@
package org.betterx.bclib.api.v2.levelgen;
import org.betterx.bclib.api.v2.generator.BCLChunkGenerator;
import org.betterx.bclib.api.v2.generator.BCLibEndBiomeSource;
import org.betterx.bclib.api.v2.generator.BCLibNetherBiomeSource;
import org.betterx.bclib.api.v2.generator.config.BCLEndBiomeSourceConfig;
import org.betterx.bclib.api.v2.generator.config.BCLNetherBiomeSourceConfig;
import org.betterx.worlds.together.levelgen.WorldGenUtil;
import com.mojang.serialization.Lifecycle;
import net.minecraft.core.Holder;
import net.minecraft.core.MappedRegistry;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.dimension.DimensionType;
import net.minecraft.world.level.dimension.LevelStem;
import java.util.Map;
import org.jetbrains.annotations.NotNull;
public class LevelGenUtil {
private static final String TAG_VERSION = "version";
private static final String TAG_BN_GEN_VERSION = "generator_version";
@NotNull
public static LevelStem getBCLNetherLevelStem(WorldGenUtil.Context context, BCLNetherBiomeSourceConfig config) {
BCLibNetherBiomeSource netherSource = new BCLibNetherBiomeSource(config);
return new LevelStem(
context.dimension,
new BCLChunkGenerator(
netherSource,
context.generatorSettings
)
);
}
public static LevelStem getBCLEndLevelStem(WorldGenUtil.Context context, BCLEndBiomeSourceConfig config) {
BCLibEndBiomeSource endSource = new BCLibEndBiomeSource(config);
return new LevelStem(
context.dimension,
new BCLChunkGenerator(
endSource,
context.generatorSettings
)
);
}
public static Registry<LevelStem> replaceGenerator(
ResourceKey<LevelStem> dimensionKey,
ResourceKey<DimensionType> dimensionTypeKey,
RegistryAccess registryAccess,
Registry<LevelStem> dimensionRegistry,
ChunkGenerator generator
) {
Registry<DimensionType> dimensionTypeRegistry = registryAccess.registryOrThrow(Registries.DIMENSION_TYPE);
Registry<LevelStem> newDimensions = withDimension(
dimensionKey,
dimensionTypeKey,
dimensionTypeRegistry,
dimensionRegistry,
generator
);
return newDimensions;
}
public static Registry<LevelStem> withDimension(
ResourceKey<LevelStem> dimensionKey,
ResourceKey<DimensionType> dimensionTypeKey,
Registry<DimensionType> dimensionTypeRegistry,
Registry<LevelStem> inputDimensions,
ChunkGenerator generator
) {
LevelStem levelStem = inputDimensions.get(dimensionKey);
Holder<DimensionType> dimensionType = levelStem == null
? dimensionTypeRegistry.getHolderOrThrow(dimensionTypeKey)
: levelStem.type();
return withDimension(dimensionKey, inputDimensions, new LevelStem(dimensionType, generator));
}
public static Registry<LevelStem> withDimension(
ResourceKey<LevelStem> dimensionKey,
Registry<LevelStem> inputDimensions,
LevelStem levelStem
) {
MappedRegistry<LevelStem> writableRegistry = new MappedRegistry<>(
Registries.LEVEL_STEM,
Lifecycle.experimental()
);
writableRegistry.register(
dimensionKey,
levelStem,
Lifecycle.stable()
);
for (Map.Entry<ResourceKey<LevelStem>, LevelStem> entry : inputDimensions.entrySet()) {
ResourceKey<LevelStem> resourceKey = entry.getKey();
if (resourceKey == dimensionKey) continue;
writableRegistry.register(
resourceKey,
entry.getValue(),
inputDimensions.lifecycle(entry.getValue())
);
}
return writableRegistry;
}
}

View file

@ -8,7 +8,6 @@ import org.betterx.bclib.mixin.common.BiomeGenerationSettingsAccessor;
import org.betterx.bclib.util.CollectionsUtil;
import org.betterx.bclib.util.Pair;
import org.betterx.ui.ColorUtil;
import org.betterx.worlds.together.surfaceRules.SurfaceRuleRegistry;
import org.betterx.worlds.together.tag.v3.TagManager;
import net.minecraft.core.Holder;
@ -953,7 +952,6 @@ public class BCLBiomeBuilder {
final T bclBiome = biomeConstructor.apply(ResourceKey.create(Registries.BIOME, biomeID), settings);
tags.forEach(tagKey -> TagManager.BIOMES.add(tagKey, bclBiome.getBiomeKey()));
SurfaceRuleRegistry.registerRule(biomeID, surfaceRule, biomeID);
bclBiome.addClimateParameters(parameters);
if (biomeType != null)
bclBiome._setIntendedType(biomeType);

View file

@ -5,8 +5,6 @@ import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiome;
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeRegistry;
import org.betterx.bclib.api.v2.levelgen.biomes.BiomeData;
import org.betterx.bclib.blocks.BaseStairsBlock;
import org.betterx.worlds.together.surfaceRules.AssignedSurfaceRule;
import org.betterx.worlds.together.surfaceRules.SurfaceRuleRegistry;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
@ -169,10 +167,7 @@ public class DumpDatapack {
new Dumper<>((DimensionType v) -> DimensionType.DIRECT_CODEC)
);
DUMPERS.put(BCLBiomeRegistry.BCL_BIOMES_REGISTRY.location(), new Dumper<>((BCLBiome v) -> v.codec().codec()));
DUMPERS.put(
SurfaceRuleRegistry.SURFACE_RULES_REGISTRY.location(),
new Dumper<>((AssignedSurfaceRule v) -> AssignedSurfaceRule.CODEC)
);
DUMPERS.put(
Registries.CONFIGURED_CARVER.location(),
new Dumper<>((ConfiguredWorldCarver v) -> ConfiguredWorldCarver.DIRECT_CODEC)

View file

@ -1,9 +0,0 @@
package org.betterx.bclib.interfaces;
import net.minecraft.core.Holder;
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
public interface NoiseGeneratorSettingsProvider {
NoiseGeneratorSettings bclib_getNoiseGeneratorSettings();
Holder<NoiseGeneratorSettings> bclib_getNoiseGeneratorSettingHolders();
}

View file

@ -1,23 +0,0 @@
package org.betterx.bclib.mixin.common;
import net.minecraft.world.level.biome.BiomeSource;
import net.minecraft.world.level.biome.FeatureSorter;
import net.minecraft.world.level.chunk.ChunkGenerator;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;
import java.util.List;
import java.util.function.Supplier;
@Mixin(ChunkGenerator.class)
public interface ChunkGeneratorAccessor {
@Accessor("biomeSource")
@Mutable
void bcl_setBiomeSource(BiomeSource biomeSource);
@Accessor("featuresPerStep")
@Mutable
void bcl_setFeaturesPerStep(Supplier<List<FeatureSorter.StepFeatureData>> supplier);
}

View file

@ -1,25 +0,0 @@
package org.betterx.bclib.mixin.common;
import org.betterx.bclib.BCLib;
import org.betterx.bclib.api.v2.generator.BCLChunkGenerator;
import com.mojang.serialization.Codec;
import net.minecraft.core.Registry;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.chunk.ChunkGenerators;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(ChunkGenerators.class)
public class ChunkGeneratorsMixin {
@Inject(method = "bootstrap", at = @At(value = "HEAD"))
private static void bcl_bootstrap(
Registry<Codec<? extends ChunkGenerator>> registry,
CallbackInfoReturnable<Codec<? extends ChunkGenerator>> cir
) {
Registry.register(registry, BCLib.makeID("betterx"), BCLChunkGenerator.CODEC);
}
}

View file

@ -1,64 +0,0 @@
package org.betterx.bclib.mixin.common;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.WritableRegistry;
import net.minecraft.world.level.dimension.DimensionType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(DimensionType.class)
public class DimensionTypeMixin {
// @Inject(
// method = "defaultDimensions(Lnet/minecraft/core/RegistryAccess;JZ)Lnet/minecraft/core/Registry;",
// locals = LocalCapture.CAPTURE_FAILHARD,
// at = @At("TAIL")
// )
private static void bclib_updateDimensions(
RegistryAccess registryAccess,
long seed,
boolean bl,
CallbackInfoReturnable<Registry> info,
WritableRegistry writableRegistry,
Registry registry,
Registry biomeRegistry,
Registry structureRegistry,
Registry noiseSettingsRegistry,
Registry noiseParamRegistry
) {
//This probably moved to WorldPresets.bootstrap();
// int id = writableRegistry.getId(writableRegistry.get(LevelStem.NETHER));
// writableRegistry.registerOrOverride(
// OptionalInt.of(id),
// LevelStem.NETHER,
// new LevelStem(
// registry.getOrCreateHolder(BuiltinDimensionTypes.NETHER),
// new NoiseBasedChunkGenerator(
// structureRegistry,
// noiseParamRegistry,
// new BCLibNetherBiomeSource(biomeRegistry, seed),
// seed,
// noiseSettingsRegistry.getOrCreateHolder(NoiseGeneratorSettings.NETHER))
// ),
// Lifecycle.stable()
// );
//
//
// id = writableRegistry.getId(writableRegistry.get(LevelStem.END));
// writableRegistry.registerOrOverride(
// OptionalInt.of(id),
// LevelStem.END,
// new LevelStem(
// registry.getOrCreateHolder(BuiltinDimensionTypes.END),
// new NoiseBasedChunkGenerator(
// structureRegistry,
// noiseParamRegistry,
// new BCLibEndBiomeSource(biomeRegistry, seed),
// seed,
// noiseSettingsRegistry.getOrCreateHolder(NoiseGeneratorSettings.END))
// ),
// Lifecycle.stable()
// );
}
}

View file

@ -1,25 +0,0 @@
package org.betterx.bclib.mixin.common;
import com.mojang.datafixers.DSL;
import net.minecraft.util.datafix.fixes.MissingDimensionFix;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import java.util.HashMap;
import java.util.Map;
@Mixin(MissingDimensionFix.class)
public class MissingDimensionFixMixin {
@ModifyArg(method = "makeRule", at = @At(value = "INVOKE", target = "Lcom/mojang/datafixers/DSL;taggedChoiceType(Ljava/lang/String;Lcom/mojang/datafixers/types/Type;Ljava/util/Map;)Lcom/mojang/datafixers/types/Type;"))
Map<String, Object> bcl_addGenerator(Map<String, Object> map) {
if (map.containsKey("minecraft:flat")) {
Map<String, Object> nMap = new HashMap<>(map);
nMap.put("bclib:betterx", DSL.remainderType());
return nMap;
}
return map;
}
}

View file

@ -1,30 +0,0 @@
package org.betterx.bclib.mixin.common;
import org.betterx.bclib.interfaces.NoiseGeneratorSettingsProvider;
import org.betterx.bclib.interfaces.SurfaceProvider;
import net.minecraft.core.Holder;
import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(NoiseBasedChunkGenerator.class)
public abstract class NoiseBasedChunkGeneratorMixin implements SurfaceProvider, NoiseGeneratorSettingsProvider {
@Final
@Shadow
protected Holder<NoiseGeneratorSettings> settings;
@Override
public NoiseGeneratorSettings bclib_getNoiseGeneratorSettings() {
return settings.value();
}
@Override
public Holder<NoiseGeneratorSettings> bclib_getNoiseGeneratorSettingHolders() {
return settings;
}
}

View file

@ -1,23 +0,0 @@
package org.betterx.bclib.mixin.common;
import org.betterx.bclib.api.v2.generator.BCLChunkGenerator;
import com.mojang.datafixers.types.templates.TypeTemplate;
import net.minecraft.util.datafix.schemas.V2551;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import java.util.Map;
import java.util.function.Supplier;
@Mixin(V2551.class)
public class V2551Mixin {
@ModifyArg(method = "method_28297", at = @At(value = "INVOKE", target = "Lcom/mojang/datafixers/DSL;taggedChoiceLazy(Ljava/lang/String;Lcom/mojang/datafixers/types/Type;Ljava/util/Map;)Lcom/mojang/datafixers/types/templates/TaggedChoice;"))
private static Map<String, Supplier<TypeTemplate>> bcl_addGenerator(Map<String, Supplier<TypeTemplate>> map) {
return BCLChunkGenerator.addGeneratorDSL(map);
}
}

View file

@ -1,21 +0,0 @@
package org.betterx.bclib.mixin.common;
import org.betterx.bclib.api.v2.generator.BCLChunkGenerator;
import com.mojang.datafixers.types.templates.TypeTemplate;
import net.minecraft.util.datafix.schemas.V2832;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import java.util.Map;
import java.util.function.Supplier;
@Mixin(V2832.class)
public class V2832Mixin {
@ModifyArg(method = "method_38837", at = @At(value = "INVOKE", target = "Lcom/mojang/datafixers/DSL;taggedChoiceLazy(Ljava/lang/String;Lcom/mojang/datafixers/types/Type;Ljava/util/Map;)Lcom/mojang/datafixers/types/templates/TaggedChoice;"))
private static Map<String, Supplier<TypeTemplate>> bcl_addGenerator(Map<String, Supplier<TypeTemplate>> map) {
return BCLChunkGenerator.addGeneratorDSL(map);
}
}

View file

@ -9,15 +9,11 @@ import org.betterx.datagen.bclib.tests.TestConfiguredFeatures;
import org.betterx.datagen.bclib.tests.TestPlacedFeatures;
import org.betterx.datagen.bclib.tests.TestStructure;
import org.betterx.datagen.bclib.worldgen.BiomeDatagenProvider;
import org.betterx.datagen.bclib.worldgen.NoiseTypesDataProvider;
import org.betterx.datagen.bclib.worldgen.VanillaBCLBiomesDataProvider;
import org.betterx.worlds.together.WorldsTogether;
import org.betterx.worlds.together.surfaceRules.AssignedSurfaceRule;
import org.betterx.worlds.together.surfaceRules.SurfaceRuleRegistry;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.minecraft.world.level.levelgen.structure.Structure;
@ -45,7 +41,6 @@ public class BCLRegistrySupplier extends RegistrySupplier {
BiomeData.CODEC,
VanillaBCLBiomesDataProvider::bootstrap
);
registries.addUnfiltered(SurfaceRuleRegistry.SURFACE_RULES_REGISTRY, AssignedSurfaceRule.CODEC);
if (BCLib.ADD_TEST_DATA) {
registries.add(Registries.STRUCTURE, Structure.DIRECT_CODEC, TestStructure::bootstrap);
@ -61,12 +56,6 @@ public class BCLRegistrySupplier extends RegistrySupplier {
registries.add(Registries.BIOME, Biome.DIRECT_CODEC, BiomeDatagenProvider::bootstrap);
}
registries.add(
Registries.NOISE_SETTINGS,
NoiseGeneratorSettings.DIRECT_CODEC,
NoiseTypesDataProvider::bootstrap
);
return registries;
}
}

View file

@ -1,16 +0,0 @@
package org.betterx.datagen.bclib.worldgen;
import org.betterx.bclib.api.v2.generator.BCLChunkGenerator;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
public class NoiseTypesDataProvider {
public static void bootstrap(BootstapContext<NoiseGeneratorSettings> bootstrapContext) {
bootstrapContext.register(
BCLChunkGenerator.AMPLIFIED_NETHER,
BCLChunkGenerator.amplifiedNether(bootstrapContext)
);
}
}

View file

@ -1,6 +1,5 @@
package org.betterx.worlds.together;
import org.betterx.worlds.together.surfaceRules.SurfaceRuleRegistry;
import org.betterx.worlds.together.tag.v3.TagManager;
import org.betterx.worlds.together.util.Logger;
import org.betterx.worlds.together.world.WorldConfig;
@ -24,8 +23,6 @@ public class WorldsTogether {
public static void onInitialize() {
TagManager.ensureStaticallyLoaded();
SurfaceRuleRegistry.ensureStaticallyLoaded();
WorldConfig.registerModCache(WorldsTogether.MOD_ID);
}

View file

@ -1,20 +0,0 @@
package org.betterx.worlds.together.chunkgenerator;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.dimension.LevelStem;
public class ChunkGeneratorUtils {
public static void restoreOriginalBiomeSourceInAllDimension(Registry<LevelStem> dimensionRegistry) {
for (var entry : dimensionRegistry.entrySet()) {
ResourceKey<LevelStem> key = entry.getKey();
LevelStem stem = entry.getValue();
if (stem.generator() instanceof RestorableBiomeSource<?> generator) {
generator.restoreInitialBiomeSource(key);
}
}
}
}

View file

@ -1,42 +0,0 @@
package org.betterx.worlds.together.chunkgenerator;
import org.betterx.worlds.together.biomesource.BiomeSourceWithConfig;
import org.betterx.worlds.together.biomesource.MergeableBiomeSource;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.biome.BiomeSource;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.dimension.DimensionType;
import net.minecraft.world.level.dimension.LevelStem;
public interface EnforceableChunkGenerator<G extends ChunkGenerator> {
Registry<LevelStem> enforceGeneratorInWorldGenSettings(
RegistryAccess access,
ResourceKey<LevelStem> dimensionKey,
ResourceKey<DimensionType> dimensionTypeKey,
ChunkGenerator loadedChunkGenerator,
Registry<LevelStem> dimensionRegistry
);
default boolean togetherShouldRepair(ChunkGenerator chunkGenerator) {
ChunkGenerator self = (ChunkGenerator) this;
if (this == chunkGenerator || chunkGenerator == null) return false;
BiomeSource one = self.getBiomeSource();
BiomeSource two = chunkGenerator.getBiomeSource();
if (one == two) return false;
if (one instanceof BiomeSourceWithConfig<?, ?> ba && two instanceof BiomeSourceWithConfig<?, ?> bb) {
if (!ba.getTogetherConfig().couldSetWithoutRepair(bb.getTogetherConfig()))
return true;
}
if (one instanceof MergeableBiomeSource ba) {
if (ba.togetherShouldMerge(two))
return true;
}
return !one.getClass().isAssignableFrom(two.getClass()) && !two.getClass().isAssignableFrom(one.getClass());
}
}

View file

@ -1,21 +0,0 @@
package org.betterx.worlds.together.chunkgenerator;
import org.betterx.worlds.together.surfaceRules.SurfaceRuleUtil;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
public interface InjectableSurfaceRules<G extends ChunkGenerator> {
/**
* Called when the Surface Rules for this BiomeSource need to be
*
* @param dimensionKey The Dimension for which this injection is performed
*/
default void injectSurfaceRules(ResourceKey<LevelStem> dimensionKey) {
if (this instanceof NoiseBasedChunkGenerator nbc) {
SurfaceRuleUtil.injectSurfaceRules(dimensionKey, nbc.generatorSettings().value(), nbc.getBiomeSource());
}
}
}

View file

@ -1,9 +0,0 @@
package org.betterx.worlds.together.chunkgenerator;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.dimension.LevelStem;
public interface RestorableBiomeSource<B extends ChunkGenerator> {
void restoreInitialBiomeSource(ResourceKey<LevelStem> dimensionKey);
}

View file

@ -2,10 +2,7 @@ package org.betterx.worlds.together.mixin.client;
import org.betterx.worlds.together.world.event.WorldBootstrap;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.worldselection.CreateWorldScreen;
import net.minecraft.client.gui.screens.worldselection.WorldCreationContext;
import net.minecraft.client.gui.screens.worldselection.WorldCreationUiState;
import net.minecraft.world.level.storage.LevelStorageSource;
@ -13,11 +10,9 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Optional;
import java.util.OptionalLong;
@Mixin(CreateWorldScreen.class)
public abstract class CreateWorldScreen_Mixin {
@ -27,22 +22,10 @@ public abstract class CreateWorldScreen_Mixin {
@Shadow
private boolean recreated;
@Inject(method = "<init>", at = @At("TAIL"))
private void wt_init(
Minecraft minecraft,
Screen screen,
WorldCreationContext worldCreationContext,
Optional optional,
OptionalLong optionalLong,
CallbackInfo ci
) {
//WorldBootstrap.InGUI.registryReadyOnNewWorld(worldGenSettingsComponent);
}
//this is called when a new world is first created
@Inject(method = "createNewWorldDirectory", at = @At("RETURN"))
void wt_createNewWorld(CallbackInfoReturnable<Optional<LevelStorageSource.LevelStorageAccess>> cir) {
WorldBootstrap.InGUI.registryReadyOnNewWorld(this.getUiState().getSettings());
WorldBootstrap.InGUI.setupNewWorld(cir.getReturnValue(), this.getUiState(), this.recreated);
WorldBootstrap.Helpers.onRegistryReady(this.getUiState().getSettings().worldgenLoadContext());
}
}

View file

@ -5,10 +5,6 @@ import org.betterx.worlds.together.world.event.WorldBootstrap;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.worldselection.WorldOpenFlows;
import net.minecraft.core.RegistryAccess;
import net.minecraft.world.level.LevelSettings;
import net.minecraft.world.level.levelgen.WorldDimensions;
import net.minecraft.world.level.levelgen.WorldOptions;
import net.minecraft.world.level.storage.LevelStorageSource;
import org.spongepowered.asm.mixin.Final;
@ -18,8 +14,6 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.function.Function;
@Mixin(WorldOpenFlows.class)
public abstract class WorldOpenFlowsMixin {
@ -49,17 +43,4 @@ public abstract class WorldOpenFlowsMixin {
}
}
}
@Inject(method = "createFreshLevel", at = @At("HEAD"))
public void wt_createFreshLevel(
String levelID,
LevelSettings levelSettings,
WorldOptions worldOptions,
Function<RegistryAccess, WorldDimensions> function,
CallbackInfo ci
) {
WorldsTogether.LOGGER.warning("called createFreshLevel...");
//TODO: 1.19.3 no mor dimensions at this stage...
//WorldBootstrap.InFreshLevel.setupNewWorld(levelID, worldGenSettings, this.levelSource, Optional.empty());
}
}

View file

@ -1,18 +0,0 @@
package org.betterx.worlds.together.mixin.common;
import org.betterx.worlds.together.biomesource.BiomeSourceHelper;
import net.minecraft.world.level.biome.BiomeSource;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(BiomeSource.class)
public class BiomeSourceMixin {
@Override
public String toString() {
BiomeSource self = (BiomeSource) (Object) this;
return "\n" + getClass().getSimpleName() + " (" + Integer.toHexString(hashCode()) + ")" +
"\n biomes = " + self.possibleBiomes().size() +
"\n namespaces = " + BiomeSourceHelper.getNamespaces(self.possibleBiomes());
}
}

View file

@ -1,26 +0,0 @@
package org.betterx.worlds.together.mixin.common;
import net.minecraft.data.Main;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(Main.class)
public class MainDataMixin {
// @Inject(method = "createStandardGenerator", at = @At("RETURN"))
// private static void wt_createStandardGenerator(
// Path path,
// Collection<Path> collection,
// boolean isClient,
// boolean isServer,
// boolean isDev,
// boolean reports,
// boolean validate,
// WorldVersion worldVersion,
// boolean alwaysGenerate,
// CallbackInfoReturnable<DataGenerator> cir
// ) {
// DataGenerator dataGenerator = cir.getReturnValue();
// dataGenerator.addProvider(isServer, new SurfaceRulesDatapackGenerator(dataGenerator.getVanillaPackOutput()));
// cir.setReturnValue(dataGenerator);
// }
}

View file

@ -1,49 +0,0 @@
package org.betterx.worlds.together.mixin.common;
import org.betterx.worlds.together.chunkgenerator.ChunkGeneratorUtils;
import com.mojang.datafixers.DataFixer;
import net.minecraft.core.LayeredRegistryAccess;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.RegistryLayer;
import net.minecraft.server.Services;
import net.minecraft.server.WorldStem;
import net.minecraft.server.level.progress.ChunkProgressListenerFactory;
import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.storage.LevelStorageSource;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.net.Proxy;
@Mixin(value = MinecraftServer.class, priority = 2000)
public class MinecraftServerMixinLate {
@Shadow
@Final
private LayeredRegistryAccess<RegistryLayer> registries;
@Inject(at = @At("RETURN"), method = "<init>")
private void bcl_restoreBiomeSource(
Thread thread,
LevelStorageSource.LevelStorageAccess levelStorageAccess,
PackRepository packRepository,
WorldStem worldStem,
Proxy proxy,
DataFixer dataFixer,
Services services,
ChunkProgressListenerFactory chunkProgressListenerFactory,
CallbackInfo ci
) {
final Registry<LevelStem> dimensionRegistry = this.registries.compositeAccess()
.registryOrThrow(Registries.LEVEL_STEM);
ChunkGeneratorUtils.restoreOriginalBiomeSourceInAllDimension(dimensionRegistry);
}
}

View file

@ -1,11 +0,0 @@
package org.betterx.worlds.together.mixin.common;
import org.betterx.worlds.together.chunkgenerator.InjectableSurfaceRules;
import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(NoiseBasedChunkGenerator.class)
public class NoiseBasedChunkGeneratorMixin implements InjectableSurfaceRules {
}

View file

@ -1,36 +0,0 @@
package org.betterx.worlds.together.mixin.common;
import org.betterx.worlds.together.WorldsTogether;
import org.betterx.worlds.together.surfaceRules.SurfaceRuleProvider;
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
import net.minecraft.world.level.levelgen.SurfaceRules;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(NoiseGeneratorSettings.class)
public abstract class NoiseGeneratorSettingsMixin implements SurfaceRuleProvider {
@Mutable
@Final
@Shadow
private SurfaceRules.RuleSource surfaceRule;
public void bclib_overwriteSurfaceRules(SurfaceRules.RuleSource surfaceRule) {
if (surfaceRule == null || surfaceRule == this.surfaceRule) return;
if (this.bcl_containsOverride) {
WorldsTogether.LOGGER.warning("Overwriting an overwritten set of Surface Rules.");
}
this.bcl_containsOverride = true;
this.surfaceRule = surfaceRule;
}
public SurfaceRules.RuleSource bclib_getOriginalSurfaceRules() {
return this.surfaceRule;
}
private boolean bcl_containsOverride = false;
}

View file

@ -1,36 +0,0 @@
package org.betterx.worlds.together.mixin.common;
import org.betterx.worlds.together.surfaceRules.AssignedSurfaceRule;
import org.betterx.worlds.together.surfaceRules.SurfaceRuleRegistry;
import net.minecraft.resources.RegistryDataLoader;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.ArrayList;
import java.util.List;
@Mixin(RegistryDataLoader.class)
public abstract class RegistryDataLoaderMixin {
@Accessor("WORLDGEN_REGISTRIES")
@Mutable
static void wt_set_WORLDGEN_REGISTRIES(List<RegistryDataLoader.RegistryData<?>> list) {
//SHADOWED
}
@Inject(method = "<clinit>", at = @At("TAIL"))
private static void wt_init(CallbackInfo ci) {
List<RegistryDataLoader.RegistryData<?>> enhanced = new ArrayList(RegistryDataLoader.WORLDGEN_REGISTRIES.size() + 1);
enhanced.addAll(RegistryDataLoader.WORLDGEN_REGISTRIES);
enhanced.add(new RegistryDataLoader.RegistryData<>(
SurfaceRuleRegistry.SURFACE_RULES_REGISTRY,
AssignedSurfaceRule.CODEC
));
wt_set_WORLDGEN_REGISTRIES(enhanced);
}
}

View file

@ -1,12 +0,0 @@
package org.betterx.worlds.together.mixin.common;
import net.minecraft.resources.RegistryOps;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(RegistryOps.class)
public interface RegistryOpsAccessor {
@Accessor("lookupProvider")
RegistryOps.RegistryInfoLookup bcl_getLookupProvider();
}

View file

@ -1,34 +0,0 @@
package org.betterx.worlds.together.mixin.common;
import org.betterx.worlds.together.surfaceRules.SurfaceRuleRegistry;
import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.data.registries.VanillaRegistries;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(VanillaRegistries.class)
public class VanillaRegistriesMixin {
@Shadow
@Final
private static RegistrySetBuilder BUILDER;
@Inject(method = "<clinit>", at = @At(value = "TAIL"))
private static void together_registerSurface(CallbackInfo ci) {
//this code is only needed for the DataGen procedure...
// BUILDER.add(
// BCLBiomeRegistry.BCL_BIOMES_REGISTRY,
// BCLBiomeRegistry::bootstrap
// );
BUILDER.add(
SurfaceRuleRegistry.SURFACE_RULES_REGISTRY,
SurfaceRuleRegistry::bootstrap
);
}
}

View file

@ -1,21 +0,0 @@
package org.betterx.worlds.together.mixin.common;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.levelgen.presets.WorldPreset;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;
import java.util.Map;
@Mixin(WorldPreset.class)
public interface WorldPresetAccessor {
@Accessor("dimensions")
Map<ResourceKey<LevelStem>, LevelStem> bcl_getDimensions();
@Accessor("dimensions")
@Mutable
void bcl_setDimensions(Map<ResourceKey<LevelStem>, LevelStem> map);
}

View file

@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.ModifyVariable;
public class WorldStem_Mixin {
@ModifyVariable(method = "<init>", argsOnly = true, at = @At(value = "INVOKE", target = "Ljava/lang/Record;<init>()V", shift = At.Shift.AFTER))
LayeredRegistryAccess<RegistryLayer> wt_bake(LayeredRegistryAccess<RegistryLayer> registries) {
LayeredRegistryAccess<RegistryLayer> rNew = WorldBootstrap.enforceInLayeredRegistry(registries);
return rNew;
WorldBootstrap.Helpers.onRegistryReady(registries.compositeAccess());
return registries;
}
}

View file

@ -1,24 +0,0 @@
package org.betterx.worlds.together.surfaceRules;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.levelgen.SurfaceRules;
public class AssignedSurfaceRule {
public static final Codec<AssignedSurfaceRule> CODEC = RecordCodecBuilder.create(instance -> instance
.group(
SurfaceRules.RuleSource.CODEC.fieldOf("ruleSource").forGetter(o -> o.ruleSource),
ResourceLocation.CODEC.fieldOf("biome").forGetter(o -> o.biomeID)
)
.apply(instance, AssignedSurfaceRule::new)
);
public final SurfaceRules.RuleSource ruleSource;
public final ResourceLocation biomeID;
AssignedSurfaceRule(SurfaceRules.RuleSource ruleSource, ResourceLocation biomeID) {
this.ruleSource = ruleSource;
this.biomeID = biomeID;
}
}

View file

@ -1,8 +0,0 @@
package org.betterx.worlds.together.surfaceRules;
import net.minecraft.world.level.levelgen.SurfaceRules;
public interface SurfaceRuleProvider {
void bclib_overwriteSurfaceRules(SurfaceRules.RuleSource surfaceRule);
SurfaceRules.RuleSource bclib_getOriginalSurfaceRules();
}

View file

@ -1,75 +0,0 @@
package org.betterx.worlds.together.surfaceRules;
import org.betterx.worlds.together.WorldsTogether;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.levelgen.SurfaceRules;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Predicate;
import org.jetbrains.annotations.ApiStatus;
public class SurfaceRuleRegistry {
public static final ResourceKey<Registry<AssignedSurfaceRule>> SURFACE_RULES_REGISTRY =
createRegistryKey(WorldsTogether.makeID("worldgen/betterx/surface_rules"));
public static final Predicate<ResourceKey<LevelStem>> NON_MANAGED_DIMENSIONS = dim -> dim != LevelStem.NETHER && dim != LevelStem.END;
public static final Predicate<ResourceKey<LevelStem>> ALL_DIMENSIONS = dim -> true;
//public static Registry<AssignedSurfaceRule> BUILTIN_SURFACE_RULES;
private static <T> ResourceKey<Registry<T>> createRegistryKey(ResourceLocation location) {
return ResourceKey.createRegistryKey(location);
}
@ApiStatus.Internal
public static void bootstrap(BootstapContext<AssignedSurfaceRule> ctx) {
// ctx.register(
// ResourceKey.create(
// SurfaceRuleRegistry.SURFACE_RULES_REGISTRY,
// WorldsTogether.makeID("dummy")
// ),
// new AssignedSurfaceRule(
// SurfaceRules.state(Blocks.YELLOW_CONCRETE.defaultBlockState()),
// WorldsTogether.makeID("none")
// )
// );
for (var entry : KNOWN.entrySet()) {
ctx.register(entry.getKey(), entry.getValue());
}
}
private static Map<ResourceKey<AssignedSurfaceRule>, AssignedSurfaceRule> KNOWN = new HashMap<>();
public static ResourceKey<AssignedSurfaceRule> registerRule(
ResourceLocation ruleID,
SurfaceRules.RuleSource rules,
ResourceLocation biomeID
) {
final ResourceKey<AssignedSurfaceRule> key = ResourceKey.create(
SurfaceRuleRegistry.SURFACE_RULES_REGISTRY,
ruleID
);
KNOWN.put(
key,
new AssignedSurfaceRule(
SurfaceRules.ifTrue(
SurfaceRules.isBiome(ResourceKey.create(Registries.BIOME, biomeID)),
rules
), biomeID
)
);
return key;
}
public static void ensureStaticallyLoaded() {
}
}

View file

@ -1,121 +0,0 @@
package org.betterx.worlds.together.surfaceRules;
import org.betterx.bclib.BCLib;
import org.betterx.bclib.config.Configs;
import org.betterx.worlds.together.chunkgenerator.InjectableSurfaceRules;
import org.betterx.worlds.together.world.event.WorldBootstrap;
import net.minecraft.core.Registry;
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.BiomeSource;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
import net.minecraft.world.level.levelgen.SurfaceRules;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
public class SurfaceRuleUtil {
private static List<SurfaceRules.RuleSource> getRulesForBiome(ResourceLocation biomeID) {
Registry<AssignedSurfaceRule> registry = null;
if (WorldBootstrap.getLastRegistryAccess() != null)
registry = WorldBootstrap.getLastRegistryAccess()
.registryOrThrow(SurfaceRuleRegistry.SURFACE_RULES_REGISTRY);
if (registry == null) return List.of();
return registry.stream()
.filter(a -> a != null && a.biomeID != null && a.biomeID.equals(
biomeID))
.map(a -> a.ruleSource)
.toList();
}
private static List<SurfaceRules.RuleSource> getRulesForBiomes(List<Biome> biomes) {
Registry<Biome> biomeRegistry = WorldBootstrap.getLastRegistryAccess().registryOrThrow(Registries.BIOME);
List<ResourceLocation> biomeIDs = biomes.stream()
.map(b -> biomeRegistry.getKey(b))
.filter(id -> id != null)
.toList();
return biomeIDs.stream()
.map(biomeID -> getRulesForBiome(biomeID))
.flatMap(List::stream)
.collect(Collectors.toCollection(LinkedList::new));
}
private static SurfaceRules.RuleSource mergeSurfaceRules(
ResourceKey<LevelStem> dimensionKey,
SurfaceRules.RuleSource org,
BiomeSource source,
List<SurfaceRules.RuleSource> additionalRules
) {
if (additionalRules == null || additionalRules.isEmpty()) return null;
final int count = additionalRules.size();
if (org instanceof SurfaceRules.SequenceRuleSource sequenceRule) {
List<SurfaceRules.RuleSource> existingSequence = sequenceRule.sequence();
additionalRules = additionalRules
.stream()
.filter(r -> existingSequence.indexOf(r) < 0)
.collect(Collectors.toList());
if (additionalRules.isEmpty()) return null;
// when we are in the nether, we want to keep the nether roof and floor rules in the beginning of the sequence
// we will add our rules whne the first biome test sequence is found
if (dimensionKey.equals(LevelStem.NETHER)) {
final List<SurfaceRules.RuleSource> combined = new ArrayList<>(existingSequence.size() + additionalRules.size());
for (SurfaceRules.RuleSource rule : existingSequence) {
if (rule instanceof SurfaceRules.TestRuleSource testRule
&& testRule.ifTrue() instanceof SurfaceRules.BiomeConditionSource) {
combined.addAll(additionalRules);
}
combined.add(rule);
}
additionalRules = combined;
} else {
additionalRules.addAll(existingSequence);
}
} else {
if (!additionalRules.contains(org))
additionalRules.add(org);
}
if (Configs.MAIN_CONFIG.verboseLogging()) {
BCLib.LOGGER.info("Merged " + count + " additional Surface Rules for " + source + " => " + additionalRules.size());
}
return new SurfaceRules.SequenceRuleSource(additionalRules);
}
public static void injectSurfaceRules(
ResourceKey<LevelStem> dimensionKey,
NoiseGeneratorSettings noiseSettings,
BiomeSource loadedBiomeSource
) {
if (((Object) noiseSettings) instanceof SurfaceRuleProvider srp) {
SurfaceRules.RuleSource originalRules = srp.bclib_getOriginalSurfaceRules();
srp.bclib_overwriteSurfaceRules(mergeSurfaceRules(
dimensionKey,
originalRules,
loadedBiomeSource,
getRulesForBiomes(loadedBiomeSource.possibleBiomes().stream().map(h -> h.value()).toList())
));
}
}
public static void injectSurfaceRulesToAllDimensions(Registry<LevelStem> dimensionRegistry) {
for (var entry : dimensionRegistry.entrySet()) {
ResourceKey<LevelStem> key = entry.getKey();
LevelStem stem = entry.getValue();
if (stem.generator() instanceof InjectableSurfaceRules<?> generator) {
generator.injectSurfaceRules(key);
}
}
}
}

View file

@ -1,14 +0,0 @@
package org.betterx.worlds.together.world.event;
import net.minecraft.core.Holder;
import net.minecraft.world.level.levelgen.WorldDimensions;
import net.minecraft.world.level.levelgen.presets.WorldPreset;
public class AdaptWorldPresetSettingEvent extends EventImpl<OnAdaptWorldPresetSettings> {
public Holder<WorldPreset> emit(Holder<WorldPreset> start, WorldDimensions worldDims) {
for (OnAdaptWorldPresetSettings a : handlers) {
start = a.adapt(start, worldDims);
}
return start;
}
}

View file

@ -1,13 +0,0 @@
package org.betterx.worlds.together.world.event;
import net.minecraft.core.Holder;
import net.minecraft.world.level.levelgen.WorldDimensions;
import net.minecraft.world.level.levelgen.presets.WorldPreset;
@FunctionalInterface
public interface OnAdaptWorldPresetSettings {
Holder<WorldPreset> adapt(
Holder<WorldPreset> currentPreset,
WorldDimensions worldDims
);
}

View file

@ -1,20 +1,14 @@
package org.betterx.worlds.together.world.event;
import org.betterx.bclib.BCLib;
import org.betterx.bclib.config.Configs;
import org.betterx.worlds.together.WorldsTogether;
import org.betterx.worlds.together.surfaceRules.SurfaceRuleUtil;
import org.betterx.worlds.together.world.WorldConfig;
import net.minecraft.client.gui.screens.worldselection.WorldCreationContext;
import net.minecraft.client.gui.screens.worldselection.WorldCreationUiState;
import net.minecraft.core.Holder;
import net.minecraft.core.LayeredRegistryAccess;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.RegistryLayer;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.levelgen.WorldDimensions;
import net.minecraft.world.level.levelgen.presets.WorldPreset;
@ -58,7 +52,7 @@ public class WorldBootstrap {
WorldConfig.load(new File(levelBaseDir, "data"));
}
private static void onRegistryReady(RegistryAccess a) {
public static void onRegistryReady(RegistryAccess a) {
if (a != LAST_REGISTRY_ACCESS) {
LAST_REGISTRY_ACCESS = a;
WorldEventsImpl.WORLD_REGISTRY_READY.emit(e -> e.initRegistry(a));
@ -115,36 +109,11 @@ public class WorldBootstrap {
}
public static class InGUI {
public static void registryReadyOnNewWorld(WorldCreationContext worldGenSettingsComponent) {
Helpers.onRegistryReady(worldGenSettingsComponent.worldgenLoadContext());
}
public static void registryReady(RegistryAccess access) {
Helpers.onRegistryReady(access);
}
public static void setupNewWorld(
Optional<LevelStorageSource.LevelStorageAccess> levelStorageAccess,
WorldCreationUiState uiState,
boolean recreated
) {
if (levelStorageAccess.isPresent()) {
Holder<WorldPreset> currentPreset = uiState.getWorldType().preset();
currentPreset = Helpers.presetFromDatapack(currentPreset);
Holder<WorldPreset> newPreset = setupNewWorldCommon(
levelStorageAccess.get(),
currentPreset
);
if (newPreset != null && newPreset != currentPreset) {
uiState.setWorldType(new WorldCreationUiState.WorldTypeEntry(newPreset));
}
} else {
WorldsTogether.LOGGER.error("Unable to access Level Folder.");
}
}
static Holder<WorldPreset> setupNewWorldCommon(
LevelStorageSource.LevelStorageAccess levelStorageAccess,
Holder<WorldPreset> currentPreset
@ -230,35 +199,16 @@ public class WorldBootstrap {
}
public static void finalizeWorldGenSettings(Registry<LevelStem> dimensionRegistry) {
String output = "World Dimensions: ";
for (var entry : dimensionRegistry.entrySet()) {
WorldEventsImpl.ON_FINALIZE_LEVEL_STEM.emit(e -> e.now(
dimensionRegistry,
entry.getKey(),
entry.getValue()
));
if (Configs.MAIN_CONFIG.verboseLogging())
output += "\n - " + entry.getKey().location().toString() + ": " +
"\n " + entry.getValue().generator().toString() + " " +
entry.getValue()
.generator()
.getBiomeSource()
.toString()
.replace("\n", "\n ");
}
if (Configs.MAIN_CONFIG.verboseLogging())
BCLib.LOGGER.info(output);
SurfaceRuleUtil.injectSurfaceRulesToAllDimensions(dimensionRegistry);
WorldEventsImpl.ON_FINALIZED_WORLD_LOAD.emit(e -> e.done(dimensionRegistry));
}
public static LayeredRegistryAccess<RegistryLayer> enforceInLayeredRegistry(LayeredRegistryAccess<RegistryLayer> registries) {
RegistryAccess access = registries.compositeAccess();
Helpers.onRegistryReady(access);
return registries;
}
}

View file

@ -7,7 +7,6 @@ public class WorldEvents {
public static final Event<OnFinalizeLevelStem> ON_FINALIZE_LEVEL_STEM = WorldEventsImpl.ON_FINALIZE_LEVEL_STEM;
public static final Event<OnFinalizeWorldLoad> ON_FINALIZED_WORLD_LOAD = WorldEventsImpl.ON_FINALIZED_WORLD_LOAD;
public static final Event<OnWorldPatch> PATCH_WORLD = WorldEventsImpl.PATCH_WORLD;
public static final Event<OnAdaptWorldPresetSettings> ADAPT_WORLD_PRESET = WorldEventsImpl.ADAPT_WORLD_PRESET;
public static final Event<BeforeAddingTags> BEFORE_ADDING_TAGS = WorldEventsImpl.BEFORE_ADDING_TAGS;
}

View file

@ -6,13 +6,13 @@ import org.jetbrains.annotations.ApiStatus;
public class WorldEventsImpl {
public static final EventImpl<OnWorldRegistryReady> WORLD_REGISTRY_READY = new EventImpl<>();
public static final EventImpl<BeforeWorldLoad> BEFORE_WORLD_LOAD = new EventImpl<>();
public static final EventImpl<OnWorldLoad> ON_WORLD_LOAD = new EventImpl<>();
public static final EventImpl<OnFinalizeLevelStem> ON_FINALIZE_LEVEL_STEM = new EventImpl<>();
public static final EventImpl<OnFinalizeWorldLoad> ON_FINALIZED_WORLD_LOAD = new EventImpl<>();
public static final PatchWorldEvent PATCH_WORLD = new PatchWorldEvent();
public static final AdaptWorldPresetSettingEvent ADAPT_WORLD_PRESET = new AdaptWorldPresetSettingEvent();
public static final EventImpl<BeforeAddingTags> BEFORE_ADDING_TAGS = new EventImpl<>();
}

View file

@ -4,17 +4,46 @@
"package": "org.betterx.bclib.mixin.common",
"compatibilityLevel": "JAVA_17",
"mixins": [
"AnvilBlockMixin", "AnvilMenuMixin", "BiomeGenerationSettingsAccessor", "BiomeMixin", "BiomeSourceMixin",
"BoneMealItemMixin", "ChunkGeneratorAccessor", "ChunkGeneratorMixin", "ChunkGeneratorsMixin",
"ComposterBlockAccessor", "CraftingMenuMixin", "DiggerItemMixin", "EnchantingTableBlockMixin", "ItemStackMixin",
"LayerLightSectionStorageMixin", "LootPoolMixin", "MissingDimensionFixMixin", "MobSpawnSettingsAccessor",
"NoiseBasedChunkGeneratorMixin", "PistonBaseBlockMixin", "PoiTypeMixin", "PortalShapeMixin",
"PotionBrewingAccessor", "RecipeManagerMixin", "RecipeMixin", "RegistryDataLoaderMixin", "ServerLevelMixin",
"ShovelItemAccessor", "SurfaceRulesContextAccessor", "TheEndBiomesMixin", "V2551Mixin", "V2832Mixin",
"WorldGenRegionMixin", "boat.BoatItemMixin", "boat.BoatMixin", "boat.ChestBoatMixin", "elytra.LivingEntityMixin",
"shears.BeehiveBlockMixin", "shears.DiggingEnchantmentMixin", "shears.ItemPredicateBuilderMixin",
"shears.MushroomCowMixin", "shears.PumpkinBlockMixin", "shears.SheepMixin", "shears.SnowGolemMixin",
"shears.TripWireBlockMixin", "signs.BlockEntityTypeMixin"
"AnvilBlockMixin",
"AnvilMenuMixin",
"BiomeGenerationSettingsAccessor",
"BiomeMixin",
"BiomeSourceMixin",
"BoneMealItemMixin",
"ChunkGeneratorMixin",
"ComposterBlockAccessor",
"CraftingMenuMixin",
"DiggerItemMixin",
"EnchantingTableBlockMixin",
"ItemStackMixin",
"LayerLightSectionStorageMixin",
"LootPoolMixin",
"MobSpawnSettingsAccessor",
"PistonBaseBlockMixin",
"PoiTypeMixin",
"PortalShapeMixin",
"PotionBrewingAccessor",
"RecipeManagerMixin",
"RecipeMixin",
"RegistryDataLoaderMixin",
"ServerLevelMixin",
"ShovelItemAccessor",
"SurfaceRulesContextAccessor",
"TheEndBiomesMixin",
"WorldGenRegionMixin",
"boat.BoatItemMixin",
"boat.BoatMixin",
"boat.ChestBoatMixin",
"elytra.LivingEntityMixin",
"shears.BeehiveBlockMixin",
"shears.DiggingEnchantmentMixin",
"shears.ItemPredicateBuilderMixin",
"shears.MushroomCowMixin",
"shears.PumpkinBlockMixin",
"shears.SheepMixin",
"shears.SnowGolemMixin",
"shears.TripWireBlockMixin",
"signs.BlockEntityTypeMixin"
],
"injectors": {
"defaultRequire": 1

View file

@ -4,10 +4,11 @@
"package": "org.betterx.worlds.together.mixin.common",
"compatibilityLevel": "JAVA_17",
"mixins": [
"BiomeSourceMixin", "DiggerItemAccessor", "MainDataMixin", "MainMixin",
"MinecraftServerMixin", "MinecraftServerMixinLate", "NoiseBasedChunkGeneratorMixin",
"NoiseGeneratorSettingsMixin", "RegistryDataLoaderMixin", "RegistryOpsAccessor", "TagLoaderMixin",
"VanillaRegistriesMixin", "WorldLoaderMixin", "WorldPresetAccessor",
"DiggerItemAccessor",
"MainMixin",
"MinecraftServerMixin",
"TagLoaderMixin",
"WorldLoaderMixin",
"WorldStem_Mixin"
],
"injectors": {