minecraft-source/src/net/minecraft/world/level/levelgen/flat/FlatLevelGeneratorSettings....

438 lines
26 KiB
Java

package net.minecraft.world.level.levelgen.flat;
import net.minecraft.Util;
import net.minecraft.world.level.levelgen.placement.ChanceDecoratorConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.BlockStateConfiguration;
import net.minecraft.world.level.levelgen.placement.ConfiguredDecorator;
import net.minecraft.world.level.levelgen.feature.configurations.DecoratorConfiguration;
import net.minecraft.world.level.levelgen.placement.FeatureDecorator;
import net.minecraft.world.level.levelgen.feature.Feature;
import org.apache.logging.log4j.LogManager;
import net.minecraft.world.level.levelgen.feature.configurations.ShipwreckConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.OceanRuinConfiguration;
import net.minecraft.world.level.levelgen.structure.OceanRuinFeature;
import net.minecraft.world.level.levelgen.feature.configurations.VillageConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.MineshaftConfiguration;
import net.minecraft.world.level.levelgen.feature.MineshaftFeature;
import java.util.HashMap;
import net.minecraft.util.Mth;
import net.minecraft.world.level.biome.Biomes;
import com.google.common.base.Splitter;
import java.util.Collection;
import net.minecraft.world.level.chunk.ChunkGeneratorType;
import java.util.stream.Collector;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.mojang.datafixers.util.Pair;
import java.util.stream.Stream;
import com.google.common.collect.ImmutableMap;
import com.mojang.datafixers.Dynamic;
import com.mojang.datafixers.types.DynamicOps;
import java.util.Collections;
import java.util.Locale;
import java.util.Iterator;
import net.minecraft.world.level.block.Blocks;
import javax.annotation.Nullable;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import com.google.common.collect.Maps;
import com.google.common.collect.Lists;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.biome.Biome;
import java.util.List;
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
import net.minecraft.world.level.levelgen.GenerationStep;
import java.util.Map;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import org.apache.logging.log4j.Logger;
import net.minecraft.world.level.levelgen.ChunkGeneratorSettings;
public class FlatLevelGeneratorSettings extends ChunkGeneratorSettings {
private static final Logger LOGGER;
private static final ConfiguredFeature<?, ?> MINESHAFT_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> VILLAGE_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> STRONGHOLD_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> SWAMPHUT_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> DESERT_PYRAMID_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> JUNGLE_PYRAMID_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> IGLOO_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> SHIPWRECK_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> OCEAN_MONUMENT_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> WATER_LAKE_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> LAVA_LAKE_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> ENDCITY_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> WOOLAND_MANSION_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> FORTRESS_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> OCEAN_RUIN_COMPOSITE_FEATURE;
private static final ConfiguredFeature<?, ?> PILLAGER_OUTPOST_COMPOSITE_FEATURE;
public static final Map<ConfiguredFeature<?, ?>, GenerationStep.Decoration> STRUCTURE_FEATURES_STEP;
public static final Map<String, ConfiguredFeature<?, ?>[]> STRUCTURE_FEATURES;
public static final Map<ConfiguredFeature<?, ?>, FeatureConfiguration> STRUCTURE_FEATURES_DEFAULT;
private final List<FlatLayerInfo> layersInfo;
private final Map<String, Map<String, String>> structuresOptions;
private Biome biome;
private final BlockState[] layers;
private boolean voidGen;
private int seaLevel;
public FlatLevelGeneratorSettings() {
this.layersInfo = Lists.newArrayList();
this.structuresOptions = Maps.newHashMap();
this.layers = new BlockState[256];
}
@Nullable
public static Block byString(final String string) {
try {
final ResourceLocation sm2 = new ResourceLocation(string);
return Registry.BLOCK.getOptional(sm2).orElse(null);
}
catch (IllegalArgumentException illegalArgumentException2) {
FlatLevelGeneratorSettings.LOGGER.warn("Invalid blockstate: {}", string, illegalArgumentException2);
return null;
}
}
public Biome getBiome() {
return this.biome;
}
public void setBiome(final Biome bkq) {
this.biome = bkq;
}
public Map<String, Map<String, String>> getStructuresOptions() {
return this.structuresOptions;
}
public List<FlatLayerInfo> getLayersInfo() {
return this.layersInfo;
}
public void updateLayers() {
int integer2 = 0;
for (final FlatLayerInfo ciu4 : this.layersInfo) {
ciu4.setStart(integer2);
integer2 += ciu4.getHeight();
}
this.seaLevel = 0;
this.voidGen = true;
integer2 = 0;
for (final FlatLayerInfo ciu4 : this.layersInfo) {
for (int integer3 = ciu4.getStart(); integer3 < ciu4.getStart() + ciu4.getHeight(); ++integer3) {
final BlockState byg6 = ciu4.getBlockState();
if (byg6.getBlock() != Blocks.AIR) {
this.voidGen = false;
this.layers[integer3] = byg6;
}
}
if (ciu4.getBlockState().getBlock() == Blocks.AIR) {
integer2 += ciu4.getHeight();
}
else {
this.seaLevel += ciu4.getHeight() + integer2;
integer2 = 0;
}
}
}
@Override
public String toString() {
final StringBuilder stringBuilder2 = new StringBuilder();
for (int integer3 = 0; integer3 < this.layersInfo.size(); ++integer3) {
if (integer3 > 0) {
stringBuilder2.append(",");
}
stringBuilder2.append(this.layersInfo.get(integer3));
}
stringBuilder2.append(";");
stringBuilder2.append(Registry.BIOME.getKey(this.biome));
stringBuilder2.append(";");
if (!this.structuresOptions.isEmpty()) {
int integer3 = 0;
for (final Map.Entry<String, Map<String, String>> entry5 : this.structuresOptions.entrySet()) {
if (integer3++ > 0) {
stringBuilder2.append(",");
}
stringBuilder2.append(entry5.getKey().toLowerCase(Locale.ROOT));
final Map<String, String> map6 = entry5.getValue();
if (!map6.isEmpty()) {
stringBuilder2.append("(");
int integer4 = 0;
for (final Map.Entry<String, String> entry6 : map6.entrySet()) {
if (integer4++ > 0) {
stringBuilder2.append(" ");
}
stringBuilder2.append(entry6.getKey());
stringBuilder2.append("=");
stringBuilder2.append(entry6.getValue());
}
stringBuilder2.append(")");
}
}
}
return stringBuilder2.toString();
}
@Nullable
private static FlatLayerInfo getLayerInfoFromString(final String string, final int integer) {
final String[] arr3 = string.split("\\*", 2);
int integer2 = 0;
Label_0051: {
if (arr3.length == 2) {
try {
integer2 = Math.max(Integer.parseInt(arr3[0]), 0);
break Label_0051;
}
catch (NumberFormatException numberFormatException5) {
FlatLevelGeneratorSettings.LOGGER.error("Error while parsing flat world string => {}", numberFormatException5.getMessage());
return null;
}
}
integer2 = 1;
}
final int integer3 = Math.min(integer + integer2, 256);
final int integer4 = integer3 - integer;
Block bpe7;
try {
bpe7 = byString(arr3[arr3.length - 1]);
}
catch (Exception exception8) {
FlatLevelGeneratorSettings.LOGGER.error("Error while parsing flat world string => {}", exception8.getMessage());
return null;
}
if (bpe7 == null) {
FlatLevelGeneratorSettings.LOGGER.error("Error while parsing flat world string => Unknown block, {}", arr3[arr3.length - 1]);
return null;
}
final FlatLayerInfo ciu8 = new FlatLayerInfo(integer4, bpe7);
ciu8.setStart(integer);
return ciu8;
}
private static List<FlatLayerInfo> getLayersInfoFromString(final String string) {
final List<FlatLayerInfo> list2 = Lists.newArrayList();
final String[] arr3 = string.split(",");
int integer4 = 0;
for (final String string2 : arr3) {
final FlatLayerInfo ciu9 = getLayerInfoFromString(string2, integer4);
if (ciu9 == null) {
return Collections.<FlatLayerInfo>emptyList();
}
list2.add(ciu9);
integer4 += ciu9.getHeight();
}
return list2;
}
public <T> Dynamic<T> toObject(final DynamicOps<T> dynamicOps) {
final T object3 = (T)dynamicOps.createList((Stream)this.layersInfo.stream().map(ciu -> dynamicOps.createMap((Map)ImmutableMap.of(dynamicOps.createString("height"), dynamicOps.createInt(ciu.getHeight()), dynamicOps.createString("block"), dynamicOps.createString(Registry.BLOCK.getKey(ciu.getBlockState().getBlock()).toString())))));
final T object4 = (T)dynamicOps.createMap((Map)this.structuresOptions.entrySet().stream().map(entry -> Pair.of(dynamicOps.createString(entry.getKey().toLowerCase(Locale.ROOT)), dynamicOps.createMap((Map)((Map)entry.getValue()).entrySet().stream().map(entry -> Pair.of(dynamicOps.createString((String)entry.getKey()), dynamicOps.createString((String)entry.getValue()))).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond))))).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond)));
return (Dynamic<T>)new Dynamic((DynamicOps)dynamicOps, dynamicOps.createMap((Map)ImmutableMap.of(dynamicOps.createString("layers"), object3, dynamicOps.createString("biome"), dynamicOps.createString(Registry.BIOME.getKey(this.biome).toString()), dynamicOps.createString("structures"), object4)));
}
public static FlatLevelGeneratorSettings fromObject(final Dynamic<?> dynamic) {
final FlatLevelGeneratorSettings civ2 = ChunkGeneratorType.FLAT.createSettings();
final List<Pair<Integer, Block>> list3 = (List<Pair<Integer, Block>>)dynamic.get("layers").asList(dynamic -> Pair.of(dynamic.get("height").asInt(1), byString(dynamic.get("block").asString(""))));
if (list3.stream().anyMatch(pair -> pair.getSecond() == null)) {
return getDefault();
}
final List<FlatLayerInfo> list4 = list3.stream().map(pair -> new FlatLayerInfo((int)pair.getFirst(), (Block)pair.getSecond())).collect(Collectors.toList());
if (list4.isEmpty()) {
return getDefault();
}
civ2.getLayersInfo().addAll(list4);
civ2.updateLayers();
civ2.setBiome(Registry.BIOME.get(new ResourceLocation(dynamic.get("biome").asString(""))));
dynamic.get("structures").flatMap((Function)Dynamic::getMapValues).ifPresent(map -> map.keySet().forEach(dynamic -> dynamic.asString().map(string -> civ2.getStructuresOptions().put(string, Maps.newHashMap()))));
return civ2;
}
public static FlatLevelGeneratorSettings fromString(final String string) {
final Iterator<String> iterator2 = Splitter.on(';').split(string).iterator();
if (!iterator2.hasNext()) {
return getDefault();
}
final FlatLevelGeneratorSettings civ3 = ChunkGeneratorType.FLAT.createSettings();
final List<FlatLayerInfo> list4 = getLayersInfoFromString(iterator2.next());
if (list4.isEmpty()) {
return getDefault();
}
civ3.getLayersInfo().addAll(list4);
civ3.updateLayers();
Biome bkq5 = Biomes.PLAINS;
if (iterator2.hasNext()) {
try {
final ResourceLocation sm6 = new ResourceLocation(iterator2.next());
final Object o;
final Object obj;
bkq5 = Registry.BIOME.getOptional(sm6).<Throwable>orElseThrow(() -> {
new IllegalArgumentException("Invalid Biome: " + obj);
return o;
});
}
catch (Exception exception6) {
FlatLevelGeneratorSettings.LOGGER.error("Error while parsing flat world string => {}", exception6.getMessage());
}
}
civ3.setBiome(bkq5);
if (iterator2.hasNext()) {
final String[] split;
final String[] arr6 = split = iterator2.next().toLowerCase(Locale.ROOT).split(",");
for (final String string2 : split) {
final String[] arr7 = string2.split("\\(", 2);
if (!arr7[0].isEmpty()) {
civ3.addStructure(arr7[0]);
if (arr7.length > 1 && arr7[1].endsWith(")") && arr7[1].length() > 1) {
final String[] split2;
final String[] arr8 = split2 = arr7[1].substring(0, arr7[1].length() - 1).split(" ");
for (final String string3 : split2) {
final String[] arr9 = string3.split("=", 2);
if (arr9.length == 2) {
civ3.addStructureOption(arr7[0], arr9[0], arr9[1]);
}
}
}
}
}
}
else {
civ3.getStructuresOptions().put("village", Maps.newHashMap());
}
return civ3;
}
private void addStructure(final String string) {
final Map<String, String> map3 = Maps.newHashMap();
this.structuresOptions.put(string, map3);
}
private void addStructureOption(final String string1, final String string2, final String string3) {
this.structuresOptions.get(string1).put(string2, string3);
if ("village".equals(string1) && "distance".equals(string2)) {
this.villagesSpacing = Mth.getInt(string3, this.villagesSpacing, 9);
}
if ("biome_1".equals(string1) && "distance".equals(string2)) {
this.templesSpacing = Mth.getInt(string3, this.templesSpacing, 9);
}
if ("stronghold".equals(string1)) {
if ("distance".equals(string2)) {
this.strongholdsDistance = Mth.getInt(string3, this.strongholdsDistance, 1);
}
else if ("count".equals(string2)) {
this.strongholdsCount = Mth.getInt(string3, this.strongholdsCount, 1);
}
else if ("spread".equals(string2)) {
this.strongholdsSpread = Mth.getInt(string3, this.strongholdsSpread, 1);
}
}
if ("oceanmonument".equals(string1)) {
if ("separation".equals(string2)) {
this.monumentsSeparation = Mth.getInt(string3, this.monumentsSeparation, 1);
}
else if ("spacing".equals(string2)) {
this.monumentsSpacing = Mth.getInt(string3, this.monumentsSpacing, 1);
}
}
if ("endcity".equals(string1) && "distance".equals(string2)) {
this.endCitySpacing = Mth.getInt(string3, this.endCitySpacing, 1);
}
if ("mansion".equals(string1) && "distance".equals(string2)) {
this.woodlandMansionSpacing = Mth.getInt(string3, this.woodlandMansionSpacing, 1);
}
}
public static FlatLevelGeneratorSettings getDefault() {
final FlatLevelGeneratorSettings civ1 = ChunkGeneratorType.FLAT.createSettings();
civ1.setBiome(Biomes.PLAINS);
civ1.getLayersInfo().add(new FlatLayerInfo(1, Blocks.BEDROCK));
civ1.getLayersInfo().add(new FlatLayerInfo(2, Blocks.DIRT));
civ1.getLayersInfo().add(new FlatLayerInfo(1, Blocks.GRASS_BLOCK));
civ1.updateLayers();
civ1.getStructuresOptions().put("village", Maps.newHashMap());
return civ1;
}
public boolean isVoidGen() {
return this.voidGen;
}
public BlockState[] getLayers() {
return this.layers;
}
public void deleteLayer(final int integer) {
this.layers[integer] = null;
}
static {
LOGGER = LogManager.getLogger();
MINESHAFT_COMPOSITE_FEATURE = Feature.MINESHAFT.configured(new MineshaftConfiguration(0.004, MineshaftFeature.Type.NORMAL)).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
VILLAGE_COMPOSITE_FEATURE = Feature.VILLAGE.configured(new VillageConfiguration("village/plains/town_centers", 6)).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
STRONGHOLD_COMPOSITE_FEATURE = Feature.STRONGHOLD.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
SWAMPHUT_COMPOSITE_FEATURE = Feature.SWAMP_HUT.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
DESERT_PYRAMID_COMPOSITE_FEATURE = Feature.DESERT_PYRAMID.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
JUNGLE_PYRAMID_COMPOSITE_FEATURE = Feature.JUNGLE_TEMPLE.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
IGLOO_COMPOSITE_FEATURE = Feature.IGLOO.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
SHIPWRECK_COMPOSITE_FEATURE = Feature.SHIPWRECK.configured(new ShipwreckConfiguration(false)).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
OCEAN_MONUMENT_COMPOSITE_FEATURE = Feature.OCEAN_MONUMENT.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
WATER_LAKE_COMPOSITE_FEATURE = Feature.LAKE.configured(new BlockStateConfiguration(Blocks.WATER.defaultBlockState())).decorated(FeatureDecorator.WATER_LAKE.configured(new ChanceDecoratorConfiguration(4)));
LAVA_LAKE_COMPOSITE_FEATURE = Feature.LAKE.configured(new BlockStateConfiguration(Blocks.LAVA.defaultBlockState())).decorated(FeatureDecorator.LAVA_LAKE.configured(new ChanceDecoratorConfiguration(80)));
ENDCITY_COMPOSITE_FEATURE = Feature.END_CITY.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
WOOLAND_MANSION_COMPOSITE_FEATURE = Feature.WOODLAND_MANSION.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
FORTRESS_COMPOSITE_FEATURE = Feature.NETHER_BRIDGE.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
OCEAN_RUIN_COMPOSITE_FEATURE = Feature.OCEAN_RUIN.configured(new OceanRuinConfiguration(OceanRuinFeature.Type.COLD, 0.3f, 0.1f)).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
PILLAGER_OUTPOST_COMPOSITE_FEATURE = Feature.PILLAGER_OUTPOST.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.NOPE.configured(DecoratorConfiguration.NONE));
STRUCTURE_FEATURES_STEP = Util.<Map<ConfiguredFeature<?, ?>, GenerationStep.Decoration>>make(Maps.newHashMap(), hashMap -> {
hashMap.put(FlatLevelGeneratorSettings.MINESHAFT_COMPOSITE_FEATURE, GenerationStep.Decoration.UNDERGROUND_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.VILLAGE_COMPOSITE_FEATURE, GenerationStep.Decoration.SURFACE_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.STRONGHOLD_COMPOSITE_FEATURE, GenerationStep.Decoration.UNDERGROUND_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.SWAMPHUT_COMPOSITE_FEATURE, GenerationStep.Decoration.SURFACE_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.DESERT_PYRAMID_COMPOSITE_FEATURE, GenerationStep.Decoration.SURFACE_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.JUNGLE_PYRAMID_COMPOSITE_FEATURE, GenerationStep.Decoration.SURFACE_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.IGLOO_COMPOSITE_FEATURE, GenerationStep.Decoration.SURFACE_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.SHIPWRECK_COMPOSITE_FEATURE, GenerationStep.Decoration.SURFACE_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.OCEAN_RUIN_COMPOSITE_FEATURE, GenerationStep.Decoration.SURFACE_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.WATER_LAKE_COMPOSITE_FEATURE, GenerationStep.Decoration.LOCAL_MODIFICATIONS);
hashMap.put(FlatLevelGeneratorSettings.LAVA_LAKE_COMPOSITE_FEATURE, GenerationStep.Decoration.LOCAL_MODIFICATIONS);
hashMap.put(FlatLevelGeneratorSettings.ENDCITY_COMPOSITE_FEATURE, GenerationStep.Decoration.SURFACE_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.WOOLAND_MANSION_COMPOSITE_FEATURE, GenerationStep.Decoration.SURFACE_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.FORTRESS_COMPOSITE_FEATURE, GenerationStep.Decoration.UNDERGROUND_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.OCEAN_MONUMENT_COMPOSITE_FEATURE, GenerationStep.Decoration.SURFACE_STRUCTURES);
hashMap.put(FlatLevelGeneratorSettings.PILLAGER_OUTPOST_COMPOSITE_FEATURE, GenerationStep.Decoration.SURFACE_STRUCTURES);
return;
});
STRUCTURE_FEATURES = Util.<Map<String, ConfiguredFeature<?, ?>[]>>make(Maps.newHashMap(), hashMap -> {
hashMap.put("mineshaft", new ConfiguredFeature[] { FlatLevelGeneratorSettings.MINESHAFT_COMPOSITE_FEATURE });
hashMap.put("village", new ConfiguredFeature[] { FlatLevelGeneratorSettings.VILLAGE_COMPOSITE_FEATURE });
hashMap.put("stronghold", new ConfiguredFeature[] { FlatLevelGeneratorSettings.STRONGHOLD_COMPOSITE_FEATURE });
hashMap.put("biome_1", new ConfiguredFeature[] { FlatLevelGeneratorSettings.SWAMPHUT_COMPOSITE_FEATURE, FlatLevelGeneratorSettings.DESERT_PYRAMID_COMPOSITE_FEATURE, FlatLevelGeneratorSettings.JUNGLE_PYRAMID_COMPOSITE_FEATURE, FlatLevelGeneratorSettings.IGLOO_COMPOSITE_FEATURE, FlatLevelGeneratorSettings.OCEAN_RUIN_COMPOSITE_FEATURE, FlatLevelGeneratorSettings.SHIPWRECK_COMPOSITE_FEATURE });
hashMap.put("oceanmonument", new ConfiguredFeature[] { FlatLevelGeneratorSettings.OCEAN_MONUMENT_COMPOSITE_FEATURE });
hashMap.put("lake", new ConfiguredFeature[] { FlatLevelGeneratorSettings.WATER_LAKE_COMPOSITE_FEATURE });
hashMap.put("lava_lake", new ConfiguredFeature[] { FlatLevelGeneratorSettings.LAVA_LAKE_COMPOSITE_FEATURE });
hashMap.put("endcity", new ConfiguredFeature[] { FlatLevelGeneratorSettings.ENDCITY_COMPOSITE_FEATURE });
hashMap.put("mansion", new ConfiguredFeature[] { FlatLevelGeneratorSettings.WOOLAND_MANSION_COMPOSITE_FEATURE });
hashMap.put("fortress", new ConfiguredFeature[] { FlatLevelGeneratorSettings.FORTRESS_COMPOSITE_FEATURE });
hashMap.put("pillager_outpost", new ConfiguredFeature[] { FlatLevelGeneratorSettings.PILLAGER_OUTPOST_COMPOSITE_FEATURE });
return;
});
STRUCTURE_FEATURES_DEFAULT = Util.<Map<ConfiguredFeature<?, ?>, FeatureConfiguration>>make(Maps.newHashMap(), hashMap -> {
hashMap.put(FlatLevelGeneratorSettings.MINESHAFT_COMPOSITE_FEATURE, new MineshaftConfiguration(0.004, MineshaftFeature.Type.NORMAL));
hashMap.put(FlatLevelGeneratorSettings.VILLAGE_COMPOSITE_FEATURE, (MineshaftConfiguration)new VillageConfiguration("village/plains/town_centers", 6));
hashMap.put(FlatLevelGeneratorSettings.STRONGHOLD_COMPOSITE_FEATURE, (MineshaftConfiguration)FeatureConfiguration.NONE);
hashMap.put(FlatLevelGeneratorSettings.SWAMPHUT_COMPOSITE_FEATURE, (MineshaftConfiguration)FeatureConfiguration.NONE);
hashMap.put(FlatLevelGeneratorSettings.DESERT_PYRAMID_COMPOSITE_FEATURE, (MineshaftConfiguration)FeatureConfiguration.NONE);
hashMap.put(FlatLevelGeneratorSettings.JUNGLE_PYRAMID_COMPOSITE_FEATURE, (MineshaftConfiguration)FeatureConfiguration.NONE);
hashMap.put(FlatLevelGeneratorSettings.IGLOO_COMPOSITE_FEATURE, (MineshaftConfiguration)FeatureConfiguration.NONE);
hashMap.put(FlatLevelGeneratorSettings.OCEAN_RUIN_COMPOSITE_FEATURE, (MineshaftConfiguration)new OceanRuinConfiguration(OceanRuinFeature.Type.COLD, 0.3f, 0.9f));
hashMap.put(FlatLevelGeneratorSettings.SHIPWRECK_COMPOSITE_FEATURE, (MineshaftConfiguration)new ShipwreckConfiguration(false));
hashMap.put(FlatLevelGeneratorSettings.OCEAN_MONUMENT_COMPOSITE_FEATURE, (MineshaftConfiguration)FeatureConfiguration.NONE);
hashMap.put(FlatLevelGeneratorSettings.ENDCITY_COMPOSITE_FEATURE, (MineshaftConfiguration)FeatureConfiguration.NONE);
hashMap.put(FlatLevelGeneratorSettings.WOOLAND_MANSION_COMPOSITE_FEATURE, (MineshaftConfiguration)FeatureConfiguration.NONE);
hashMap.put(FlatLevelGeneratorSettings.FORTRESS_COMPOSITE_FEATURE, (MineshaftConfiguration)FeatureConfiguration.NONE);
hashMap.put(FlatLevelGeneratorSettings.PILLAGER_OUTPOST_COMPOSITE_FEATURE, (MineshaftConfiguration)FeatureConfiguration.NONE);
});
}
}