Feature fixes and enhancements, version change
This commit is contained in:
parent
572ee609d5
commit
8809151a8b
8 changed files with 48 additions and 38 deletions
|
@ -11,7 +11,7 @@ loader_version= 0.12.12
|
|||
fabric_version = 0.44.0+1.18
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.1.3
|
||||
mod_version = 1.1.4
|
||||
maven_group = ru.bclib
|
||||
archives_base_name = bclib
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package ru.bclib.api.biomes;
|
||||
|
||||
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.particles.ParticleOptions;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.data.worldgen.BiomeDefaultFeatures;
|
||||
import net.minecraft.data.worldgen.placement.OrePlacements;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.sounds.Music;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
|
@ -36,14 +34,12 @@ import ru.bclib.api.surface.SurfaceRuleBuilder;
|
|||
import ru.bclib.entity.BCLEntityWrapper;
|
||||
import ru.bclib.mixin.common.BiomeGenerationSettingsAccessor;
|
||||
import ru.bclib.util.ColorUtil;
|
||||
import ru.bclib.util.Pair;
|
||||
import ru.bclib.world.biomes.BCLBiome;
|
||||
import ru.bclib.world.features.BCLFeature;
|
||||
import ru.bclib.world.structures.BCLStructureFeature;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiFunction;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package ru.bclib.config;
|
||||
|
||||
import ru.bclib.BCLib;
|
||||
import ru.bclib.api.dataexchange.handler.autosync.AutoSync;
|
||||
|
||||
public class GeneratorConfig extends NamedPathConfig {
|
||||
public static final ConfigToken<Boolean> USE_OLD_GENERATOR = ConfigToken.Boolean(false, "useOldBiomeGenerator", "options");
|
||||
|
|
|
@ -9,9 +9,7 @@ import ru.bclib.integration.modmenu.ModMenuIntegration.ModMenuScreenFactory;
|
|||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
@Deprecated
|
||||
class ModMenuScreenFactoryImpl {
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfigur
|
|||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration;
|
||||
import net.minecraft.world.level.levelgen.placement.BiomeFilter;
|
||||
import net.minecraft.world.level.levelgen.placement.CountOnEveryLayerPlacement;
|
||||
import net.minecraft.world.level.levelgen.placement.CountPlacement;
|
||||
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement;
|
||||
import net.minecraft.world.level.levelgen.placement.InSquarePlacement;
|
||||
|
@ -61,6 +62,7 @@ public class BCLFeature {
|
|||
public Decoration getDecoration() {
|
||||
return featureStep;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will create a basic plant feature.
|
||||
* @param id {@link ResourceLocation} feature ID.
|
||||
|
@ -69,16 +71,28 @@ public class BCLFeature {
|
|||
* @return new BCLFeature instance.
|
||||
*/
|
||||
public static BCLFeature makeVegetationFeature(ResourceLocation id, Feature<NoneFeatureConfiguration> feature, int density) {
|
||||
PlacedFeature configured = feature
|
||||
.configured(FeatureConfiguration.NONE)
|
||||
.placed(
|
||||
CountPlacement.of(UniformInt.of(0, 4)),
|
||||
return makeVegetationFeature(id, feature, density, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Will create a basic plant feature.
|
||||
* @param id {@link ResourceLocation} feature ID.
|
||||
* @param feature {@link Feature} with {@link NoneFeatureConfiguration} config.
|
||||
* @param density iterations per chunk.
|
||||
* @param allHeight if {@code true} will generate plant on all layers, if {@code false} - only on surface.
|
||||
* @return new BCLFeature instance.
|
||||
*/
|
||||
public static BCLFeature makeVegetationFeature(ResourceLocation id, Feature<NoneFeatureConfiguration> feature, int density, boolean allHeight) {
|
||||
@SuppressWarnings("deprecation")
|
||||
PlacementModifier count = allHeight ? CountOnEveryLayerPlacement.of(8) : CountPlacement.of(UniformInt.of(0, density));
|
||||
return makeFeature(id, Decoration.VEGETAL_DECORATION, feature,
|
||||
count,
|
||||
InSquarePlacement.spread(),
|
||||
PlacementUtils.HEIGHTMAP,
|
||||
BiomeFilter.biome()
|
||||
);
|
||||
return new BCLFeature(id, feature, Decoration.VEGETAL_DECORATION, configured);
|
||||
}
|
||||
|
||||
/**
|
||||
* Will create a basic ore feature.
|
||||
* @param id {@link ResourceLocation} feature ID.
|
||||
|
@ -209,7 +223,9 @@ public class BCLFeature {
|
|||
InSquarePlacement.spread(),
|
||||
rare ? RarityFilter.onAverageOnceEvery(veins) : CountPlacement.of(veins),
|
||||
placement,
|
||||
BiomeFilter.biome());
|
||||
BiomeFilter.biome()
|
||||
);
|
||||
|
||||
return new BCLFeature(
|
||||
net.minecraft.world.level.levelgen.feature.Feature.ORE,
|
||||
Registry.register(BuiltinRegistries.PLACED_FEATURE, id, oreFeature),
|
||||
|
@ -244,10 +260,7 @@ public class BCLFeature {
|
|||
* @return new BCLFeature instance.
|
||||
*/
|
||||
public static BCLFeature makeChunkFeature(ResourceLocation id, Decoration step, Feature<NoneFeatureConfiguration> feature) {
|
||||
PlacedFeature configured = feature
|
||||
.configured(FeatureConfiguration.NONE)
|
||||
.placed(CountPlacement.of(1));
|
||||
return new BCLFeature(id, feature, step, configured);
|
||||
return makeFeature(id, step, feature, CountPlacement.of(1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -259,10 +272,7 @@ public class BCLFeature {
|
|||
* @return new BCLFeature instance.
|
||||
*/
|
||||
public static BCLFeature makeChancedFeature(ResourceLocation id, Decoration step, Feature<NoneFeatureConfiguration> feature, int chance) {
|
||||
PlacedFeature configured = feature
|
||||
.configured(FeatureConfiguration.NONE)
|
||||
.placed(RarityFilter.onAverageOnceEvery(chance));
|
||||
return new BCLFeature(id, feature, step, configured);
|
||||
return makeFeature(id, step, feature, RarityFilter.onAverageOnceEvery(chance));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -274,11 +284,7 @@ public class BCLFeature {
|
|||
* @return new BCLFeature instance.
|
||||
*/
|
||||
public static BCLFeature makeCountFeature(ResourceLocation id, Decoration step, Feature<NoneFeatureConfiguration> feature, int count) {
|
||||
PlacedFeature configured = feature
|
||||
.configured(FeatureConfiguration.NONE)
|
||||
.placed(CountPlacement.of(count));
|
||||
//.decorated(FeatureDecorator.COUNT.configured(new CountConfiguration(count)));
|
||||
return new BCLFeature(id, feature, step, configured);
|
||||
return makeFeature(id, step, feature, CountPlacement.of(count));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -289,7 +295,19 @@ public class BCLFeature {
|
|||
* @return new BCLFeature instance.
|
||||
*/
|
||||
public static BCLFeature makeFeatureConfigured(ResourceLocation id, Decoration step, Feature<NoneFeatureConfiguration> feature) {
|
||||
PlacedFeature configured = feature.configured(FeatureConfiguration.NONE).placed();
|
||||
return makeFeature(id, step, feature);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and configures new BCLib feature.
|
||||
* @param id {@link ResourceLocation} feature ID.
|
||||
* @param step {@link Decoration} feature step.
|
||||
* @param feature {@link Feature} with {@link NoneFeatureConfiguration} config.
|
||||
* @param placementModifiers array of {@link PlacementModifier}
|
||||
* @return new BCLFeature instance.
|
||||
*/
|
||||
public static BCLFeature makeFeature(ResourceLocation id, Decoration step, Feature<NoneFeatureConfiguration> feature, PlacementModifier... placementModifiers) {
|
||||
PlacedFeature configured = feature.configured(FeatureConfiguration.NONE).placed(placementModifiers);
|
||||
return new BCLFeature(id, feature, step, configured);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import net.minecraft.core.Registry;
|
|||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeSource;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.config.Configs;
|
||||
import ru.bclib.world.biomes.BCLBiome;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
"TextureAtlasMixin",
|
||||
"AnvilScreenMixin",
|
||||
"ModelBakeryMixin",
|
||||
"WorldPresetMixin",
|
||||
"MinecraftMixin",
|
||||
"GameMixin",
|
||||
"WorldPresetMixin"
|
||||
"GameMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"LayerLightSectionStorageMixin",
|
||||
"NoiseBasedChunkGeneratorMixin",
|
||||
"NoiseGeneratorSettingsMixin",
|
||||
"SurfaceRulesContextAccessor",
|
||||
"shears.TripWireBlockMixin",
|
||||
"StructureSettingsAccessor",
|
||||
"MobSpawnSettingsAccessor",
|
||||
|
@ -35,12 +36,11 @@
|
|||
"shears.SheepMixin",
|
||||
"PortalShapeMixin",
|
||||
"ServerLevelMixin",
|
||||
"BiomeSourceMixin",
|
||||
"AnvilBlockMixin",
|
||||
"AnvilMenuMixin",
|
||||
"TagLoaderMixin",
|
||||
"MainMixin",
|
||||
"SurfaceRulesContextAccessor",
|
||||
"BiomeSourceMixin"
|
||||
"MainMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue