2020-03-06 17:22:23 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* MIT License
|
|
|
|
*
|
|
|
|
* Copyright (c) 2020 TerraForged
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package com.terraforged.mod.biome;
|
|
|
|
|
|
|
|
import com.terraforged.api.biome.BiomeVariant;
|
|
|
|
import net.minecraft.entity.EntityClassification;
|
|
|
|
import net.minecraft.entity.EntityType;
|
|
|
|
import net.minecraft.world.biome.Biome;
|
|
|
|
import net.minecraft.world.biome.Biomes;
|
|
|
|
import net.minecraft.world.biome.DefaultBiomeFeatures;
|
2020-03-09 20:30:27 +00:00
|
|
|
import net.minecraft.world.gen.GenerationStage;
|
|
|
|
import net.minecraft.world.gen.feature.Feature;
|
2020-04-02 22:14:50 +00:00
|
|
|
import net.minecraft.world.gen.feature.IFeatureConfig;
|
|
|
|
import net.minecraft.world.gen.feature.structure.MineshaftConfig;
|
|
|
|
import net.minecraft.world.gen.feature.structure.MineshaftStructure;
|
2020-03-09 20:30:27 +00:00
|
|
|
import net.minecraft.world.gen.placement.FrequencyConfig;
|
|
|
|
import net.minecraft.world.gen.placement.HeightWithChanceConfig;
|
|
|
|
import net.minecraft.world.gen.placement.Placement;
|
2020-03-06 17:22:23 +00:00
|
|
|
import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder;
|
|
|
|
|
|
|
|
public class Marshland extends BiomeVariant {
|
|
|
|
public Marshland() {
|
|
|
|
super((new Builder()).surfaceBuilder(SurfaceBuilder.SWAMP, SurfaceBuilder.GRASS_DIRT_GRAVEL_CONFIG).precipitation(RainType.RAIN).category(Category.SWAMP).depth(0.2F).scale(0.2F).temperature(0.8F).downfall(0.4F).waterColor(6388580).waterFogColor(2302743).parent((String) null));
|
2020-04-02 22:14:50 +00:00
|
|
|
this.addStructure(Feature.SWAMP_HUT.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG));
|
|
|
|
this.addStructure(Feature.MINESHAFT.withConfiguration(new MineshaftConfig(0.004D, MineshaftStructure.Type.NORMAL)));
|
2020-03-06 17:22:23 +00:00
|
|
|
DefaultBiomeFeatures.addCarvers(this);
|
|
|
|
DefaultBiomeFeatures.addStructures(this);
|
|
|
|
DefaultBiomeFeatures.addMonsterRooms(this);
|
|
|
|
DefaultBiomeFeatures.addStoneVariants(this);
|
|
|
|
DefaultBiomeFeatures.addOres(this);
|
|
|
|
DefaultBiomeFeatures.addSedimentDisks(this);
|
|
|
|
DefaultBiomeFeatures.addDefaultFlowers(this);
|
|
|
|
DefaultBiomeFeatures.addTallGrass(this);
|
|
|
|
DefaultBiomeFeatures.addTallGrass(this);
|
|
|
|
DefaultBiomeFeatures.addTallGrass(this);
|
|
|
|
DefaultBiomeFeatures.addTallGrass(this);
|
|
|
|
DefaultBiomeFeatures.addGrass(this);
|
|
|
|
DefaultBiomeFeatures.addVeryDenseGrass(this);
|
|
|
|
DefaultBiomeFeatures.addReedsAndPumpkins(this);
|
2020-03-09 20:30:27 +00:00
|
|
|
Marshland.addSwampVegetation(this);
|
2020-03-06 17:22:23 +00:00
|
|
|
DefaultBiomeFeatures.addFreezeTopLayer(this);
|
|
|
|
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.SHEEP, 12, 4, 4));
|
|
|
|
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.PIG, 10, 4, 4));
|
|
|
|
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.CHICKEN, 10, 4, 4));
|
|
|
|
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.COW, 8, 4, 4));
|
|
|
|
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.WOLF, 8, 4, 4));
|
|
|
|
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.RABBIT, 4, 2, 3));
|
|
|
|
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.FOX, 8, 2, 4));
|
|
|
|
this.addSpawn(EntityClassification.AMBIENT, new SpawnListEntry(EntityType.BAT, 10, 8, 8));
|
|
|
|
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.SPIDER, 100, 4, 4));
|
|
|
|
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ZOMBIE, 95, 4, 4));
|
|
|
|
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ZOMBIE_VILLAGER, 5, 1, 1));
|
|
|
|
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.SKELETON, 100, 4, 4));
|
|
|
|
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.CREEPER, 100, 4, 4));
|
|
|
|
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.SLIME, 100, 4, 4));
|
|
|
|
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ENDERMAN, 10, 1, 4));
|
|
|
|
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.WITCH, 5, 1, 1));
|
2020-04-02 22:14:50 +00:00
|
|
|
this.setRegistryName("terraforged", "marshland");
|
2020-03-06 17:22:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public int getGrassColor(double p_225528_1_, double p_225528_3_) {
|
|
|
|
double d0 = INFO_NOISE.noiseAt(p_225528_1_ * 0.0225D, p_225528_3_ * 0.0225D, false);
|
|
|
|
return d0 < -0.1D ? 5011004 : 6975545;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getFoliageColor() {
|
|
|
|
return 6975545;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Biome getBase() {
|
|
|
|
return Biomes.SWAMP;
|
|
|
|
}
|
2020-03-09 20:30:27 +00:00
|
|
|
|
|
|
|
private static void addSwampVegetation(Biome biome) {
|
|
|
|
biome.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.withConfiguration(DefaultBiomeFeatures.LILY_PAD_CONFIG).withPlacement(Placement.COUNT_HEIGHTMAP_DOUBLE.configure(new FrequencyConfig(4))));
|
|
|
|
biome.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.withConfiguration(DefaultBiomeFeatures.DEAD_BUSH_CONFIG).withPlacement(Placement.COUNT_HEIGHTMAP_DOUBLE.configure(new FrequencyConfig(1))));
|
|
|
|
biome.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.withConfiguration(DefaultBiomeFeatures.LILY_PAD_CONFIG).withPlacement(Placement.COUNT_HEIGHTMAP_DOUBLE.configure(new FrequencyConfig(4))));
|
|
|
|
biome.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.withConfiguration(DefaultBiomeFeatures.BROWN_MUSHROOM_CONFIG).withPlacement(Placement.COUNT_CHANCE_HEIGHTMAP.configure(new HeightWithChanceConfig(8, 0.25F))));
|
|
|
|
biome.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.RANDOM_PATCH.withConfiguration(DefaultBiomeFeatures.RED_MUSHROOM_CONFIG).withPlacement(Placement.COUNT_CHANCE_HEIGHTMAP_DOUBLE.configure(new HeightWithChanceConfig(8, 0.125F))));
|
|
|
|
}
|
2020-03-06 17:22:23 +00:00
|
|
|
}
|