minecraft-source/src/net/minecraft/world/level/biome/SwampBiome.java

67 lines
4.3 KiB
Java

package net.minecraft.world.level.biome;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
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.configurations.SeagrassFeatureConfiguration;
import net.minecraft.world.level.levelgen.GenerationStep;
import net.minecraft.world.level.levelgen.feature.configurations.MineshaftConfiguration;
import net.minecraft.world.level.levelgen.feature.MineshaftFeature;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderBaseConfiguration;
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilder;
public final class SwampBiome extends Biome {
protected SwampBiome() {
super(new BiomeBuilder().<SurfaceBuilderBaseConfiguration>surfaceBuilder(SurfaceBuilder.SWAMP, SurfaceBuilder.CONFIG_GRASS).precipitation(Precipitation.RAIN).biomeCategory(BiomeCategory.SWAMP).depth(-0.2f).scale(0.1f).temperature(0.8f).downfall(0.9f).waterColor(6388580).waterFogColor(2302743).parent(null));
this.<NoneFeatureConfiguration>addStructureStart(Feature.SWAMP_HUT.configured(FeatureConfiguration.NONE));
this.<MineshaftConfiguration>addStructureStart(Feature.MINESHAFT.configured(new MineshaftConfiguration(0.004, MineshaftFeature.Type.NORMAL)));
BiomeDefaultFeatures.addDefaultCarvers(this);
BiomeDefaultFeatures.addStructureFeaturePlacement(this);
BiomeDefaultFeatures.addDefaultLakes(this);
BiomeDefaultFeatures.addDefaultMonsterRoom(this);
BiomeDefaultFeatures.addDefaultUndergroundVariety(this);
BiomeDefaultFeatures.addDefaultOres(this);
BiomeDefaultFeatures.addSwampClayDisk(this);
BiomeDefaultFeatures.addSwampVegetation(this);
BiomeDefaultFeatures.addDefaultMushrooms(this);
BiomeDefaultFeatures.addSwampExtraVegetation(this);
BiomeDefaultFeatures.addDefaultSprings(this);
this.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, Feature.SEAGRASS.configured(new SeagrassFeatureConfiguration(64, 0.6)).decorated(FeatureDecorator.TOP_SOLID_HEIGHTMAP.configured(DecoratorConfiguration.NONE)));
BiomeDefaultFeatures.addSwampExtraDecoration(this);
BiomeDefaultFeatures.addSurfaceFreezing(this);
this.addSpawn(MobCategory.CREATURE, new SpawnerData(EntityType.SHEEP, 12, 4, 4));
this.addSpawn(MobCategory.CREATURE, new SpawnerData(EntityType.PIG, 10, 4, 4));
this.addSpawn(MobCategory.CREATURE, new SpawnerData(EntityType.CHICKEN, 10, 4, 4));
this.addSpawn(MobCategory.CREATURE, new SpawnerData(EntityType.COW, 8, 4, 4));
this.addSpawn(MobCategory.AMBIENT, new SpawnerData(EntityType.BAT, 10, 8, 8));
this.addSpawn(MobCategory.MONSTER, new SpawnerData(EntityType.SPIDER, 100, 4, 4));
this.addSpawn(MobCategory.MONSTER, new SpawnerData(EntityType.ZOMBIE, 95, 4, 4));
this.addSpawn(MobCategory.MONSTER, new SpawnerData(EntityType.ZOMBIE_VILLAGER, 5, 1, 1));
this.addSpawn(MobCategory.MONSTER, new SpawnerData(EntityType.SKELETON, 100, 4, 4));
this.addSpawn(MobCategory.MONSTER, new SpawnerData(EntityType.CREEPER, 100, 4, 4));
this.addSpawn(MobCategory.MONSTER, new SpawnerData(EntityType.SLIME, 100, 4, 4));
this.addSpawn(MobCategory.MONSTER, new SpawnerData(EntityType.ENDERMAN, 10, 1, 4));
this.addSpawn(MobCategory.MONSTER, new SpawnerData(EntityType.WITCH, 5, 1, 1));
this.addSpawn(MobCategory.MONSTER, new SpawnerData(EntityType.SLIME, 1, 1, 1));
}
@Override
public int getGrassColor(final double double1, final double double2) {
final double double3 = SwampBiome.BIOME_INFO_NOISE.getValue(double1 * 0.0225, double2 * 0.0225, false);
if (double3 < -0.1) {
return 5011004;
}
return 6975545;
}
@Override
public int getFoliageColor() {
return 6975545;
}
}