From a363ea6b59083363416f7573d6e225a570121f71 Mon Sep 17 00:00:00 2001 From: Forstride Date: Fri, 24 May 2019 18:47:51 -0400 Subject: [PATCH] Re-added Mangrove --- .../biomesoplenty/api/biome/BOPBiomes.java | 1 + .../biome/overworld/FloodplainBiome.java | 5 +- .../common/biome/overworld/MangroveBiome.java | 108 ++++++++++++++++++ .../biome/overworld/RedwoodForestBiome.java | 2 +- .../common/biome/overworld/TropicsBiome.java | 4 + .../biome/overworld/WhiteBeachBiome.java | 4 + .../world/gen/feature/BOPBiomeFeatures.java | 3 +- .../gen/feature/ColdDesertSurfaceBuilder.java | 2 +- .../world/gen/feature/MangroveFeature.java | 67 +++++++++++ ...ilder.java => MangroveSurfaceBuilder.java} | 26 ++++- .../java/biomesoplenty/init/ModBiomes.java | 5 +- .../java/biomesoplenty/init/ModBlocks.java | 2 + .../textures/blocks/mangrove_root_bottom.png | Bin 0 -> 887 bytes .../textures/blocks/mangrove_root_top.png | Bin 0 -> 848 bytes .../textures/items/mangrove_root.png | Bin 0 -> 737 bytes 15 files changed, 220 insertions(+), 9 deletions(-) create mode 100644 src/main/java/biomesoplenty/common/biome/overworld/MangroveBiome.java create mode 100644 src/main/java/biomesoplenty/common/world/gen/feature/MangroveFeature.java rename src/main/java/biomesoplenty/common/world/gen/feature/{MudSurfaceBuilder.java => MangroveSurfaceBuilder.java} (68%) create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/mangrove_root_bottom.png create mode 100644 src/main/resources/assets/biomesoplenty/textures/blocks/mangrove_root_top.png create mode 100644 src/main/resources/assets/biomesoplenty/textures/items/mangrove_root.png diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index 7522c0b2b..ea3187bfc 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -35,6 +35,7 @@ public class BOPBiomes public static Optional highland_moor = Optional.empty(); public static Optional lavender_field = Optional.empty(); public static Optional lush_swamp = Optional.empty(); + public static Optional mangrove = Optional.empty(); public static Optional maple_woods = Optional.empty(); public static Optional marsh = Optional.empty(); public static Optional meadow = Optional.empty(); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/FloodplainBiome.java b/src/main/java/biomesoplenty/common/biome/overworld/FloodplainBiome.java index 0375cd6ae..688bb297d 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/FloodplainBiome.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/FloodplainBiome.java @@ -26,6 +26,7 @@ import net.minecraft.world.gen.feature.LakesConfig; import net.minecraft.world.gen.feature.LiquidsConfig; import net.minecraft.world.gen.feature.MinableConfig; import net.minecraft.world.gen.feature.ProbabilityConfig; +import net.minecraft.world.gen.feature.RandomDefaultFeatureListConfig; import net.minecraft.world.gen.feature.SeaGrassConfig; import net.minecraft.world.gen.feature.structure.JunglePyramidConfig; import net.minecraft.world.gen.feature.structure.MineshaftConfig; @@ -75,10 +76,10 @@ public class FloodplainBiome extends BiomeBOP this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.LAPIS_ORE.getDefaultState(), 7), DEPTH_AVERAGE, new DepthAverageConfig(1, 16, 16))); // Vegetation - this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(BOPBiomeFeatures.BUSH, IFeatureConfig.NO_FEATURE_CONFIG, AT_SURFACE_WITH_EXTRA, new AtSurfaceWithExtraConfig(15, 0.3F, 1))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.RANDOM_FEATURE_LIST, new RandomDefaultFeatureListConfig(new Feature[]{BOPBiomeFeatures.SPARSE_OAK_TREE, BOPBiomeFeatures.BIG_OAK_TREE}, new IFeatureConfig[]{IFeatureConfig.NO_FEATURE_CONFIG, IFeatureConfig.NO_FEATURE_CONFIG}, new float[]{0.3F, 0.1F}, BOPBiomeFeatures.BUSH, IFeatureConfig.NO_FEATURE_CONFIG), AT_SURFACE_WITH_EXTRA, new AtSurfaceWithExtraConfig(4, 0.3F, 1))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(new StandardGrassFeature(), IFeatureConfig.NO_FEATURE_CONFIG, TWICE_SURFACE, new FrequencyConfig(10))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.DOUBLE_PLANT, new DoublePlantConfig(Blocks.TALL_GRASS.getDefaultState()), SURFACE_PLUS_32, new FrequencyConfig(25))); - this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.BUSH, new BushConfig(BOPBlocks.watergrass), TWICE_SURFACE, new FrequencyConfig(150))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.BUSH, new BushConfig(BOPBlocks.watergrass), TWICE_SURFACE, new FrequencyConfig(225))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.SEA_GRASS, new SeaGrassConfig(64, 0.6D), TOP_SOLID_ONCE, IPlacementConfig.NO_PLACEMENT_CONFIG)); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.WATERLILY, IFeatureConfig.NO_FEATURE_CONFIG, TWICE_SURFACE, new FrequencyConfig(200))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.LIQUIDS, new LiquidsConfig(Fluids.WATER), HEIGHT_BIASED_RANGE, new CountRangeConfig(50, 8, 8, 256))); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/MangroveBiome.java b/src/main/java/biomesoplenty/common/biome/overworld/MangroveBiome.java new file mode 100644 index 000000000..eabea712c --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/MangroveBiome.java @@ -0,0 +1,108 @@ +/******************************************************************************* + * Copyright 2014-2019, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package biomesoplenty.common.biome.overworld; + +import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.api.enums.BOPClimates; +import biomesoplenty.common.biome.BiomeBOP; +import biomesoplenty.common.world.gen.feature.BOPBiomeFeatures; +import biomesoplenty.common.world.gen.feature.StandardGrassFeature; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.init.Fluids; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.feature.BushConfig; +import net.minecraft.world.gen.feature.DoublePlantConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.LakesConfig; +import net.minecraft.world.gen.feature.LiquidsConfig; +import net.minecraft.world.gen.feature.MinableConfig; +import net.minecraft.world.gen.feature.ProbabilityConfig; +import net.minecraft.world.gen.feature.SeaGrassConfig; +import net.minecraft.world.gen.feature.structure.MineshaftConfig; +import net.minecraft.world.gen.feature.structure.MineshaftStructure; +import net.minecraft.world.gen.feature.structure.StrongholdConfig; +import net.minecraft.world.gen.feature.structure.SwampHutConfig; +import net.minecraft.world.gen.placement.AtSurfaceWithExtraConfig; +import net.minecraft.world.gen.placement.ChanceConfig; +import net.minecraft.world.gen.placement.CountRangeConfig; +import net.minecraft.world.gen.placement.DepthAverageConfig; +import net.minecraft.world.gen.placement.DungeonRoomConfig; +import net.minecraft.world.gen.placement.FrequencyConfig; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.placement.LakeChanceConfig; +import net.minecraft.world.gen.surfacebuilders.CompositeSurfaceBuilder; + +public class MangroveBiome extends BiomeBOP +{ + public MangroveBiome() + { + super((new Biome.BiomeBuilder()).surfaceBuilder(new CompositeSurfaceBuilder(BOPBiomeFeatures.MANGROVE_SURFACE_BUILDER, GRASS_DIRT_GRAVEL_SURFACE)).precipitation(Biome.RainType.RAIN).category(Biome.Category.SWAMP).depth(-0.215F).scale(-0.025F).temperature(0.85F).downfall(0.85F).waterColor(4566514).waterFogColor(267827).parent((String)null)); + + // Mineshafts and Strongholds + this.addStructure(Feature.SWAMP_HUT, new SwampHutConfig()); + this.addStructure(Feature.MINESHAFT, new MineshaftConfig(0.004D, MineshaftStructure.Type.NORMAL)); + this.addStructure(Feature.STRONGHOLD, new StrongholdConfig()); + + this.addCarver(GenerationStage.Carving.AIR, createWorldCarverWrapper(CAVE_WORLD_CARVER, new ProbabilityConfig(0.14285715F))); + this.addCarver(GenerationStage.Carving.AIR, createWorldCarverWrapper(CANYON_WORLD_CARVER, new ProbabilityConfig(0.02F))); + + this.addStructureFeatures(); + + // Lakes + this.addFeature(GenerationStage.Decoration.LOCAL_MODIFICATIONS, createCompositeFeature(Feature.LAKES, new LakesConfig(Blocks.WATER), LAKE_WATER, new LakeChanceConfig(2))); + + // Underground + this.addFeature(GenerationStage.Decoration.UNDERGROUND_STRUCTURES, createCompositeFeature(Feature.DUNGEONS, IFeatureConfig.NO_FEATURE_CONFIG, DUNGEON_ROOM, new DungeonRoomConfig(8))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.DIRT.getDefaultState(), 33), COUNT_RANGE, new CountRangeConfig(10, 0, 0, 256))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.GRAVEL.getDefaultState(), 33), COUNT_RANGE, new CountRangeConfig(8, 0, 0, 256))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.GRANITE.getDefaultState(), 33), COUNT_RANGE, new CountRangeConfig(10, 0, 0, 80))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.DIORITE.getDefaultState(), 33), COUNT_RANGE, new CountRangeConfig(10, 0, 0, 80))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.ANDESITE.getDefaultState(), 33), COUNT_RANGE, new CountRangeConfig(10, 0, 0, 80))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.COAL_ORE.getDefaultState(), 17), COUNT_RANGE, new CountRangeConfig(20, 0, 0, 128))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.IRON_ORE.getDefaultState(), 9), COUNT_RANGE, new CountRangeConfig(20, 0, 0, 64))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.GOLD_ORE.getDefaultState(), 9), COUNT_RANGE, new CountRangeConfig(2, 0, 0, 32))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.REDSTONE_ORE.getDefaultState(), 8), COUNT_RANGE, new CountRangeConfig(8, 0, 0, 16))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.DIAMOND_ORE.getDefaultState(), 8), COUNT_RANGE, new CountRangeConfig(1, 0, 0, 16))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.MINABLE, new MinableConfig(MinableConfig.IS_ROCK, Blocks.LAPIS_ORE.getDefaultState(), 7), DEPTH_AVERAGE, new DepthAverageConfig(1, 16, 16))); + + // Vegetation + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(BOPBiomeFeatures.BUSH, IFeatureConfig.NO_FEATURE_CONFIG, AT_SURFACE_WITH_EXTRA, new AtSurfaceWithExtraConfig(15, 0.3F, 1))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(new StandardGrassFeature(), IFeatureConfig.NO_FEATURE_CONFIG, TWICE_SURFACE, new FrequencyConfig(10))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(BOPBiomeFeatures.MANGROVE, IFeatureConfig.NO_FEATURE_CONFIG, TWICE_SURFACE, new FrequencyConfig(125))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.DOUBLE_PLANT, new DoublePlantConfig(Blocks.TALL_GRASS.getDefaultState()), SURFACE_PLUS_32, new FrequencyConfig(50))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.SEA_GRASS, new SeaGrassConfig(32, 0.6D), TOP_SOLID_ONCE, IPlacementConfig.NO_PLACEMENT_CONFIG)); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.BUSH, new BushConfig(BOPBlocks.watergrass), TWICE_SURFACE, new FrequencyConfig(25))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.LIQUIDS, new LiquidsConfig(Fluids.WATER), HEIGHT_BIASED_RANGE, new CountRangeConfig(50, 8, 8, 256))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.LIQUIDS, new LiquidsConfig(Fluids.LAVA), HEIGHT_VERY_BIASED_RANGE, new CountRangeConfig(20, 8, 16, 256))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createCompositeFeature(Feature.FOSSILS, IFeatureConfig.NO_FEATURE_CONFIG, WITH_CHANCE, new ChanceConfig(64))); + this.addFeature(GenerationStage.Decoration.TOP_LAYER_MODIFICATION, createCompositeFeature(Feature.ICE_AND_SNOW, IFeatureConfig.NO_FEATURE_CONFIG, PASSTHROUGH, IPlacementConfig.NO_PLACEMENT_CONFIG)); + + // Entity spawning + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.COD, 15, 3, 6)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.SQUID, 10, 4, 4)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.PUFFERFISH, 15, 1, 3)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.TROPICAL_FISH, 25, 8, 8)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.DOLPHIN, 2, 1, 2)); + this.addSpawn(EnumCreatureType.AMBIENT, new Biome.SpawnListEntry(EntityType.BAT, 10, 8, 8)); + this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.SPIDER, 100, 4, 4)); + this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.ZOMBIE, 95, 4, 4)); + this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.ZOMBIE_VILLAGER, 5, 1, 1)); + this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.SKELETON, 100, 4, 4)); + this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.CREEPER, 100, 4, 4)); + this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.SLIME, 100, 4, 4)); + this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.ENDERMAN, 10, 1, 4)); + this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.WITCH, 5, 1, 1)); + + this.addWeight(BOPClimates.SUBTROPICAL, 5); + this.setBeachBiome((Biome)null); + } +} diff --git a/src/main/java/biomesoplenty/common/biome/overworld/RedwoodForestBiome.java b/src/main/java/biomesoplenty/common/biome/overworld/RedwoodForestBiome.java index 6dbfdd8f6..5d19708d1 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/RedwoodForestBiome.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/RedwoodForestBiome.java @@ -79,7 +79,7 @@ public class RedwoodForestBiome extends BiomeBOP this.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, createCompositeFeature(Feature.SPHERE_REPLACE, new SphereReplaceConfig(Blocks.GRAVEL, 6, 2, Lists.newArrayList(Blocks.DIRT, Blocks.GRASS_BLOCK)), TOP_SOLID, new FrequencyConfig(1))); // Vegetation - this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.RANDOM_FEATURE_LIST, new RandomDefaultFeatureListConfig(new Feature[]{BOPBiomeFeatures.REDWOOD_TREE, BOPBiomeFeatures.REDWOOD_TREE_MEDIUM, BOPBiomeFeatures.REDWOOD_TREE_LARGE}, new IFeatureConfig[]{IFeatureConfig.NO_FEATURE_CONFIG, IFeatureConfig.NO_FEATURE_CONFIG, IFeatureConfig.NO_FEATURE_CONFIG}, new float[]{0.1F, 0.5F, 0.3F}, BOPBiomeFeatures.BUSH, IFeatureConfig.NO_FEATURE_CONFIG), AT_SURFACE_WITH_EXTRA, new AtSurfaceWithExtraConfig(14, 0.2F, 1))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.RANDOM_FEATURE_LIST, new RandomDefaultFeatureListConfig(new Feature[]{BOPBiomeFeatures.REDWOOD_TREE, BOPBiomeFeatures.REDWOOD_TREE_MEDIUM, BOPBiomeFeatures.REDWOOD_TREE_LARGE}, new IFeatureConfig[]{IFeatureConfig.NO_FEATURE_CONFIG, IFeatureConfig.NO_FEATURE_CONFIG, IFeatureConfig.NO_FEATURE_CONFIG}, new float[]{0.1F, 0.5F, 0.3F}, BOPBiomeFeatures.BUSH, IFeatureConfig.NO_FEATURE_CONFIG), AT_SURFACE_WITH_EXTRA, new AtSurfaceWithExtraConfig(16, 0.2F, 1))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(new FernGrassFeature(), IFeatureConfig.NO_FEATURE_CONFIG, TWICE_SURFACE, new FrequencyConfig(12))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.BUSH, new BushConfig(Blocks.BROWN_MUSHROOM), TWICE_SURFACE_WITH_CHANCE, new ChanceConfig(4))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createCompositeFeature(Feature.BUSH, new BushConfig(Blocks.RED_MUSHROOM), TWICE_SURFACE_WITH_CHANCE, new ChanceConfig(8))); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/TropicsBiome.java b/src/main/java/biomesoplenty/common/biome/overworld/TropicsBiome.java index 9b44a3901..c7fb5d0b0 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/TropicsBiome.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/TropicsBiome.java @@ -91,6 +91,10 @@ public class TropicsBiome extends BiomeBOP // Entity spawning this.addSpawn(EnumCreatureType.CREATURE, new Biome.SpawnListEntry(EntityType.PIG, 10, 4, 4)); this.addSpawn(EnumCreatureType.CREATURE, new Biome.SpawnListEntry(EntityType.PARROT, 40, 1, 2)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.SQUID, 10, 4, 4)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.PUFFERFISH, 15, 1, 3)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.TROPICAL_FISH, 25, 8, 8)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.DOLPHIN, 2, 1, 2)); this.canSpawnInBiome = false; this.setBeachBiome(BOPBiomes.white_beach); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/WhiteBeachBiome.java b/src/main/java/biomesoplenty/common/biome/overworld/WhiteBeachBiome.java index 63b2d2d81..e4b58711a 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/WhiteBeachBiome.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/WhiteBeachBiome.java @@ -75,6 +75,10 @@ public class WhiteBeachBiome extends BiomeBOP // Entity spawning this.addSpawn(EnumCreatureType.CREATURE, new Biome.SpawnListEntry(EntityType.TURTLE, 5, 2, 5)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.SQUID, 10, 4, 4)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.PUFFERFISH, 15, 1, 3)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.TROPICAL_FISH, 25, 8, 8)); + this.addSpawn(EnumCreatureType.WATER_CREATURE, new Biome.SpawnListEntry(EntityType.DOLPHIN, 2, 1, 2)); this.canSpawnInBiome = false; this.setBeachBiome((Biome)null); diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/BOPBiomeFeatures.java b/src/main/java/biomesoplenty/common/world/gen/feature/BOPBiomeFeatures.java index 8b68d9c4c..427e9e17d 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/BOPBiomeFeatures.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/BOPBiomeFeatures.java @@ -95,6 +95,7 @@ public class BOPBiomeFeatures public static final Feature SPLOTCH = new SplotchFeature(); public static final Feature BRAMBLE = new BrambleFeature(); + public static final Feature MANGROVE = new MangroveFeature(); public static final AbstractFlowersFeature CHERRY_BLOSSOM_GROVE_FLOWERS = new CherryBlossomGroveFlowersFeature(); public static final AbstractFlowersFeature EXTENDED_FLOWERS = new ExtendedFlowersFeature(); @@ -120,7 +121,7 @@ public class BOPBiomeFeatures public static final ISurfaceBuilder COLD_DESERT_SURFACE_BUILDER = new ColdDesertSurfaceBuilder(); public static final ISurfaceBuilder GRANITE_SURFACE_BUILDER = new GraniteSurfaceBuilder(); public static final ISurfaceBuilder MARSH_SURFACE_BUILDER = new MarshSurfaceBuilder(); - public static final ISurfaceBuilder MUD_SURFACE_BUILDER = new MudSurfaceBuilder(); + public static final ISurfaceBuilder MANGROVE_SURFACE_BUILDER = new MangroveSurfaceBuilder(); public static final ISurfaceBuilder PODZOL_SURFACE_BUILDER = new PodzolSurfaceBuilder(); public static final ISurfaceBuilder VOLCANO_SURFACE_BUILDER = new VolcanoSurfaceBuilder(); public static final ISurfaceBuilder VOLCANO_EDGE_SURFACE_BUILDER = new VolcanoEdgeSurfaceBuilder(); diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/ColdDesertSurfaceBuilder.java b/src/main/java/biomesoplenty/common/world/gen/feature/ColdDesertSurfaceBuilder.java index 9c58ca23c..b543da66d 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/ColdDesertSurfaceBuilder.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/ColdDesertSurfaceBuilder.java @@ -31,7 +31,7 @@ public class ColdDesertSurfaceBuilder implements ISurfaceBuilder 2.4D) + if (noise > 2.6D) { Biome.DEFAULT_SURFACE_BUILDER.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.PACKED_ICE_SURFACE); } diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/MangroveFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/MangroveFeature.java new file mode 100644 index 000000000..1c8291ec1 --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/gen/feature/MangroveFeature.java @@ -0,0 +1,67 @@ +package biomesoplenty.common.world.gen.feature; + +import java.util.Random; + +import biomesoplenty.api.block.BOPBlocks; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IWorld; +import net.minecraft.world.gen.IChunkGenSettings; +import net.minecraft.world.gen.IChunkGenerator; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.NoFeatureConfig; + +public class MangroveFeature extends Feature { + public boolean place(IWorld p_212245_1_, IChunkGenerator p_212245_2_, Random p_212245_3_, BlockPos p_212245_4_, NoFeatureConfig p_212245_5_) { + int i = 0; + IBlockState iblockstate = BOPBlocks.mangrove_root.getDefaultState(); + + for(int j = 0; j < 64; ++j) { + BlockPos blockpos = p_212245_4_.add(p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8), p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8)); + if (p_212245_1_.isAirBlock(blockpos) && (!p_212245_1_.getDimension().isNether() || blockpos.getY() < p_212245_1_.getWorld().getHeight() - 1) && iblockstate.isValidPosition(p_212245_1_, blockpos)) { + p_212245_1_.setBlockState(blockpos, iblockstate, 2); + + BlockPos leaves1 = blockpos.up(); + BlockPos leaves2 = leaves1.north(); + BlockPos leaves3 = leaves1.south(); + BlockPos leaves4 = leaves1.east(); + BlockPos leaves5 = leaves1.west(); + BlockPos leaves6 = leaves1.up(); + + if (p_212245_1_.getBlockState(leaves1).canBeReplacedByLeaves(p_212245_1_, leaves1)) + { + p_212245_1_.setBlockState(leaves1, Blocks.OAK_LEAVES.getDefaultState().with(BlockLeaves.PERSISTENT, true), 2); + } + + if (p_212245_3_.nextInt(2) == 0) + { + if (p_212245_1_.getBlockState(leaves2).canBeReplacedByLeaves(p_212245_1_, leaves2)) + { + p_212245_1_.setBlockState(leaves2, Blocks.OAK_LEAVES.getDefaultState().with(BlockLeaves.PERSISTENT, true), 2); + } + if (p_212245_1_.getBlockState(leaves3).canBeReplacedByLeaves(p_212245_1_, leaves3)) + { + p_212245_1_.setBlockState(leaves3, Blocks.OAK_LEAVES.getDefaultState().with(BlockLeaves.PERSISTENT, true), 2); + } + if (p_212245_1_.getBlockState(leaves4).canBeReplacedByLeaves(p_212245_1_, leaves4)) + { + p_212245_1_.setBlockState(leaves4, Blocks.OAK_LEAVES.getDefaultState().with(BlockLeaves.PERSISTENT, true), 2); + } + if (p_212245_1_.getBlockState(leaves5).canBeReplacedByLeaves(p_212245_1_, leaves5)) + { + p_212245_1_.setBlockState(leaves5, Blocks.OAK_LEAVES.getDefaultState().with(BlockLeaves.PERSISTENT, true), 2); + } + if (p_212245_1_.getBlockState(leaves6).canBeReplacedByLeaves(p_212245_1_, leaves6)) + { + p_212245_1_.setBlockState(leaves6, Blocks.OAK_LEAVES.getDefaultState().with(BlockLeaves.PERSISTENT, true), 2); + } + } + ++i; + } + } + + return i > 0; + } + } \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/MudSurfaceBuilder.java b/src/main/java/biomesoplenty/common/world/gen/feature/MangroveSurfaceBuilder.java similarity index 68% rename from src/main/java/biomesoplenty/common/world/gen/feature/MudSurfaceBuilder.java rename to src/main/java/biomesoplenty/common/world/gen/feature/MangroveSurfaceBuilder.java index 39438957e..f5d1ffdca 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/MudSurfaceBuilder.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/MangroveSurfaceBuilder.java @@ -27,11 +27,31 @@ import net.minecraft.world.gen.feature.NoFeatureConfig; import net.minecraft.world.gen.surfacebuilders.ISurfaceBuilder; import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig; -public class MudSurfaceBuilder implements ISurfaceBuilder { +public class MangroveSurfaceBuilder implements ISurfaceBuilder { public void buildSurface(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, IBlockState defaultBlock, IBlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) { - if (noise > 0.2D) { + double d0 = Biome.INFO_NOISE.getValue((double)x * 0.25D, (double)z * 0.25D); + if (d0 > 0.2D) { + int i = x & 15; + int j = z & 15; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for(int k = startHeight; k >= 0; --k) { + blockpos$mutableblockpos.setPos(i, k, j); + if (!chunkIn.getBlockState(blockpos$mutableblockpos).isAir()) { + if (k == 62 && chunkIn.getBlockState(blockpos$mutableblockpos).getBlock() != defaultFluid.getBlock()) { + chunkIn.setBlockState(blockpos$mutableblockpos, defaultFluid, false); + } + break; + } + } + } + + if (noise > 0.1D) + { Biome.DEFAULT_SURFACE_BUILDER.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, BOPBiomeFeatures.MUD_SURFACE); - } else { + } + else + { Biome.DEFAULT_SURFACE_BUILDER.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, Biome.GRASS_DIRT_GRAVEL_SURFACE); } diff --git a/src/main/java/biomesoplenty/init/ModBiomes.java b/src/main/java/biomesoplenty/init/ModBiomes.java index 47976e9c7..9167f1b18 100644 --- a/src/main/java/biomesoplenty/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/init/ModBiomes.java @@ -31,6 +31,7 @@ import biomesoplenty.common.biome.overworld.GravelBeachBiome; import biomesoplenty.common.biome.overworld.GroveBiome; import biomesoplenty.common.biome.overworld.LavenderFieldBiome; import biomesoplenty.common.biome.overworld.LushSwampBiome; +import biomesoplenty.common.biome.overworld.MangroveBiome; import biomesoplenty.common.biome.overworld.MapleWoodsBiome; import biomesoplenty.common.biome.overworld.MarshBiome; import biomesoplenty.common.biome.overworld.MeadowBiome; @@ -129,6 +130,7 @@ public class ModBiomes highland_moor = registerBiome(new HighlandMoorBiome(), "highland_moor"); lavender_field = registerBiome(new LavenderFieldBiome(), "lavender_field"); lush_swamp = registerBiome(new LushSwampBiome(), "lush_swamp"); + mangrove = registerBiome(new MangroveBiome(), "mangrove"); maple_woods = registerBiome(new MapleWoodsBiome(), "maple_woods"); marsh = registerBiome(new MarshBiome(), "marsh"); meadow = registerBiome(new MeadowBiome(), "meadow"); @@ -184,8 +186,8 @@ public class ModBiomes private static void registerBiomeDictionaryTags() { - registerBiomeToDictionary(BOPBiomes.alps_foothills, Type.MOUNTAIN, Type.SNOWY, Type.FOREST, Type.SPARSE, Type.COLD, Type.DRY); registerBiomeToDictionary(BOPBiomes.alps, Type.MOUNTAIN, Type.SNOWY, Type.COLD, Type.DRY); + registerBiomeToDictionary(BOPBiomes.alps_foothills, Type.MOUNTAIN, Type.SNOWY, Type.FOREST, Type.SPARSE, Type.COLD, Type.DRY); registerBiomeToDictionary(BOPBiomes.bayou, Type.SWAMP, Type.HOT, Type.WET, Type.DENSE); registerBiomeToDictionary(BOPBiomes.bog, Type.SWAMP, Type.DEAD, Type.WET); registerBiomeToDictionary(BOPBiomes.bog_mire, Type.SWAMP, Type.DEAD, Type.WASTELAND, Type.WET); @@ -206,6 +208,7 @@ public class ModBiomes registerBiomeToDictionary(BOPBiomes.highland_moor, Type.HILLS, Type.WET); registerBiomeToDictionary(BOPBiomes.lavender_field, Type.PLAINS, Type.MAGICAL, Type.LUSH); registerBiomeToDictionary(BOPBiomes.lush_swamp, Type.SWAMP, Type.LUSH, Type.WET, Type.DENSE); + registerBiomeToDictionary(BOPBiomes.mangrove, Type.WATER, Type.SWAMP, Type.WET, Type.DENSE, Type.LUSH); registerBiomeToDictionary(BOPBiomes.maple_woods, Type.FOREST, Type.CONIFEROUS, Type.COLD, Type.DENSE); registerBiomeToDictionary(BOPBiomes.marsh, Type.WATER, Type.WET, Type.LUSH); registerBiomeToDictionary(BOPBiomes.meadow, Type.PLAINS, Type.FOREST, Type.LUSH, Type.COLD, Type.WET, Type.SPARSE); diff --git a/src/main/java/biomesoplenty/init/ModBlocks.java b/src/main/java/biomesoplenty/init/ModBlocks.java index 6df65bbb3..ae6874c66 100644 --- a/src/main/java/biomesoplenty/init/ModBlocks.java +++ b/src/main/java/biomesoplenty/init/ModBlocks.java @@ -322,6 +322,8 @@ public class ModBlocks registerBlock(reed, new ItemWaterPlant(BOPBlocks.reed, new Item.Properties().group(ItemGroupBOP.instance)), "reed"); watergrass = new BlockWaterPlant(Block.Properties.create(Material.PLANTS, MaterialColor.GRASS).doesNotBlockMovement().zeroHardnessAndResistance().sound(SoundType.PLANT)); registerBlock(watergrass, new ItemWaterPlant(BOPBlocks.watergrass, new Item.Properties().group(ItemGroupBOP.instance)), "watergrass"); + mangrove_root = new BlockWaterPlant(Block.Properties.create(Material.WOOD, MaterialColor.WHITE_TERRACOTTA).doesNotBlockMovement().zeroHardnessAndResistance().sound(SoundType.WOOD)); + registerBlock(mangrove_root, new ItemWaterPlant(BOPBlocks.mangrove_root, new Item.Properties().group(ItemGroupBOP.instance)), "mangrove_root"); bramble = registerBlock(new BlockBramble(Block.Properties.create(Material.PLANTS, MaterialColor.NETHERRACK).hardnessAndResistance(0.4F).sound(SoundType.WOOD)), "bramble"); diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/mangrove_root_bottom.png b/src/main/resources/assets/biomesoplenty/textures/blocks/mangrove_root_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..0caddd0e2dc1d3a778612b905bc2f6ed8f2a869e GIT binary patch literal 887 zcmV--1Bm>IP)N2bZe?^J zG%hhNHvLWs=l}o$^+`lQR5(vHlh;p_Q4q!F5AnelTQDK9K>!s9f|Sq}0g<*KOV1)J zO$C-J3&H||h!8-U5XAzLte}Dff~Ya^#qb1#5_(^HIWl8-xXJh3J9p;H@64sSxj8CI z2*A7Y1iaF#u(q~F04Pi81ZUHe;PU}PIevbtM}3I~d1@cz#@@pG{5;Lf%n%ukM#_ot zLW3?6I<*`2_xDNTVSzON8wj+$h^?(HDo$78``21%!`;xBABEJrF7nN>w7k4bySuye zFvJNx?Rq?k_k_yH60CsN=H@0<=0$;3aG^qt0<*KTQhjV}jN~#){`5wNp`JP<_}hW^ zvO}DqFguF?n+tNWDnAC@ZwusmZ*Pwl78Yo7a*~K8Zf|c>XG;!#^u7f1C{6Z--!)Tw ztk$4aug0TLXH?`y;Ll(Sy4vz#c%27UzPh^lKLKYf(T0GNaIe|X3e@GQP@L#3y|Suw zl`DStH=(zq7-d;u;Fgz`mWVbsHUuOm;)4&385roU7Enon_VBSh4+oPI(jFJ!7*@nE z*)d`uY*l8YhsbX#OGJB9CjS0v6IkKSRv7$JBY>GhsDn9Df^S0OXDbfT#KZ(urU#)m zCrqk7%L$jo7r5WP&Qc70u0(Tr5=t{d;eP3qRAz|Gj`-(+(h*e|N_14k3mgvQYIXX1 zlBg&(2oWw<#a@rgr@`=8wamfz_&D)oF)*f{5#f%*!$V^KIk37Q7VjIh=Fjw?R8QJJL@< zydP40tWlbxly-Qy?t5Cwo|pMKu+7Y>x#+0C(QI(R>FH?_8JWS3h;uc=<1kmb$jM^d zZIJAJ9o`luqJ}v=PYaY)k){$394pm1DD{pVqTQ_Jl?@LMi+u?SD|lWxgOQODi8ItC z;e|FBx;S4c#2n-;@SyO+VMmSu9!uw*S;5nk+royGtgo*NV58AU{{X_NjI?|#7{LGl N002ovPDHLkV1jn(l(YZ< literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/mangrove_root_top.png b/src/main/resources/assets/biomesoplenty/textures/blocks/mangrove_root_top.png new file mode 100644 index 0000000000000000000000000000000000000000..7d6a3b51a07b07cfa0a32cd653f9274f3d53e219 GIT binary patch literal 848 zcmV-W1F!svP)N2bZe?^J zG%hhNHvLWs=l}o$&PhZ;R5(vPQ)x?-VHAD-O+eBw{hP+&ADL%5A(kFJ@?*o&$*9sxm>ER zr4R=P2dcFu14~Ow>ecg1ROH3L{Zq5Ev#P5h7lp~Ukb@$*w7I$!3XIPTUVP`1<;~Qd3h?YI%8CmFMa)&{-yc z-Q8WawY8=8_xDv-2_O==yA6GI5162ia=x?=RXJ<#*3_${XSC@t-IZ?10!eKW>VyMrFf%YPF zH|7aTHjrdeq7D@AeOEaWG#62s5rOhF4IYO0AX9%G$#?wmZMYt9n)0RC5j!s&6g4j)RKT>bx48fo<4pv39K#K-lWzFGk?0iNlQ}3*ZN8hjU5~_wOPHRX zR@^j>MsdmD_m>ug`@(*D9Mn$T`KAtOvqPD(N2bZe?^J zG%hhNHvLWs=l}o$Ur9tkR5(vPlle7VTuIL>cCiTAIsf zn;ETEB-kp=;Ov`@rbWaDKnv2#^JPG#V8=(-8Ra)QF;U9(~bwS;>U&3^TuO>R7pZY@5Cxy=~Kw zJlff${_jKTtksH49-i5wD8#Nc5=f;|u>+>JAKj|X9nj#x89U1#?i z$<*KtZ8@~b8aFmJY^|tlYyml}kQc%M01U_4zDFVvn+g$|g23nVi6zg3&eOZKUawoAG&2PtBzWdGMMgYXBiR`% zO#mqfvD4Rl(7ZxatJMrcxhiPpk7ZlnB6+=DBft{!Afi|mcORVV9Yr(;gF*QRbH8Ct T$anyT00000NkvXXu0mjfab{JN literal 0 HcmV?d00001