Mod now loads. Doesn't actually do anything (yet)
This commit is contained in:
parent
57ac719093
commit
7f6ace64e9
2389 changed files with 30 additions and 72585 deletions
|
@ -17,6 +17,7 @@ buildscript {
|
||||||
apply plugin: 'net.minecraftforge.gradle'
|
apply plugin: 'net.minecraftforge.gradle'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
apply plugin: 'idea'
|
||||||
|
|
||||||
// define the properties file
|
// define the properties file
|
||||||
ext.configFile = file "build.properties"
|
ext.configFile = file "build.properties"
|
||||||
|
|
|
@ -1,65 +0,0 @@
|
||||||
/**
|
|
||||||
* This class was created by <Vazkii>. It's distributed as
|
|
||||||
* part of the Botania Mod. Get the Source Code in github:
|
|
||||||
* https://github.com/Vazkii/Botania
|
|
||||||
*
|
|
||||||
* Botania is Open Source and distributed under the
|
|
||||||
* Botania License: http://botaniamod.net/license.php
|
|
||||||
*
|
|
||||||
* File Created @ [Oct 24, 2015, 11:16:00 PM (GMT)]
|
|
||||||
*/
|
|
||||||
package vazkii.botania.api.item;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A Block that implements this can be uprooted by the various horns in Botania.
|
|
||||||
*/
|
|
||||||
public interface IHornHarvestable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if this block can be uprooted.
|
|
||||||
* Note that the stack param can be null if it's a drum breaking it.
|
|
||||||
*/
|
|
||||||
boolean canHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if harvestByHorn() should be called. If false it just uses the normal
|
|
||||||
* block breaking method.
|
|
||||||
* Note that the stack param can be null if it's a drum breaking it.
|
|
||||||
*/
|
|
||||||
boolean hasSpecialHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called to harvest by a horn.
|
|
||||||
* Note that the stack param can be null if it's a drum breaking it.
|
|
||||||
*/
|
|
||||||
void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
|
|
||||||
|
|
||||||
enum EnumHornType {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Horn of the Wild, for grass and crops
|
|
||||||
*/
|
|
||||||
WILD,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Horn of the Canopy, for leaves
|
|
||||||
*/
|
|
||||||
CANOPY,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Horn of the Covering, for snow
|
|
||||||
*/
|
|
||||||
COVERING;
|
|
||||||
|
|
||||||
public static EnumHornType getTypeForMeta(int meta) {
|
|
||||||
EnumHornType[] values = EnumHornType.values();
|
|
||||||
return values[Math.min(values.length - 1, meta)];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,161 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.api.biome;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.google.common.base.Optional;
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
|
|
||||||
import net.minecraft.world.WorldType;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BOPBiomes
|
|
||||||
{
|
|
||||||
public static final IBiomeRegistry REG_INSTANCE = createRegistry();
|
|
||||||
|
|
||||||
/**A list of world types where BoP biome decoration does not occur**/
|
|
||||||
public static List<WorldType> excludedDecoratedWorldTypes = Lists.newArrayList();
|
|
||||||
|
|
||||||
// normal biomes which have weights
|
|
||||||
public static Optional<Biome> alps = Optional.absent();
|
|
||||||
public static Optional<Biome> bamboo_forest = Optional.absent();
|
|
||||||
public static Optional<Biome> bayou = Optional.absent();
|
|
||||||
public static Optional<Biome> bog = Optional.absent();
|
|
||||||
public static Optional<Biome> boreal_forest = Optional.absent();
|
|
||||||
public static Optional<Biome> brushland = Optional.absent();
|
|
||||||
public static Optional<Biome> chaparral = Optional.absent();
|
|
||||||
public static Optional<Biome> cherry_blossom_grove = Optional.absent();
|
|
||||||
public static Optional<Biome> cold_desert = Optional.absent();
|
|
||||||
public static Optional<Biome> coniferous_forest = Optional.absent();
|
|
||||||
public static Optional<Biome> crag = Optional.absent();
|
|
||||||
public static Optional<Biome> dead_forest = Optional.absent();
|
|
||||||
public static Optional<Biome> dead_swamp = Optional.absent();
|
|
||||||
public static Optional<Biome> eucalyptus_forest = Optional.absent();
|
|
||||||
public static Optional<Biome> fen = Optional.absent();
|
|
||||||
public static Optional<Biome> flower_field = Optional.absent();
|
|
||||||
public static Optional<Biome> grassland = Optional.absent();
|
|
||||||
public static Optional<Biome> grove = Optional.absent();
|
|
||||||
public static Optional<Biome> highland = Optional.absent();
|
|
||||||
public static Optional<Biome> land_of_lakes = Optional.absent();
|
|
||||||
public static Optional<Biome> lavender_fields = Optional.absent();
|
|
||||||
public static Optional<Biome> lush_desert = Optional.absent();
|
|
||||||
public static Optional<Biome> lush_swamp = Optional.absent();
|
|
||||||
public static Optional<Biome> mangrove = Optional.absent();
|
|
||||||
public static Optional<Biome> maple_woods = Optional.absent();
|
|
||||||
public static Optional<Biome> marsh = Optional.absent();
|
|
||||||
public static Optional<Biome> meadow = Optional.absent();
|
|
||||||
public static Optional<Biome> moor = Optional.absent();
|
|
||||||
public static Optional<Biome> mountain = Optional.absent();
|
|
||||||
public static Optional<Biome> mystic_grove = Optional.absent();
|
|
||||||
public static Optional<Biome> ominous_woods = Optional.absent();
|
|
||||||
public static Optional<Biome> orchard = Optional.absent();
|
|
||||||
public static Optional<Biome> outback = Optional.absent();
|
|
||||||
public static Optional<Biome> overgrown_cliffs = Optional.absent();
|
|
||||||
public static Optional<Biome> prairie = Optional.absent();
|
|
||||||
public static Optional<Biome> quagmire = Optional.absent();
|
|
||||||
public static Optional<Biome> rainforest = Optional.absent();
|
|
||||||
public static Optional<Biome> redwood_forest = Optional.absent();
|
|
||||||
public static Optional<Biome> sacred_springs = Optional.absent();
|
|
||||||
public static Optional<Biome> seasonal_forest = Optional.absent();
|
|
||||||
public static Optional<Biome> shield = Optional.absent();
|
|
||||||
public static Optional<Biome> shrubland = Optional.absent();
|
|
||||||
public static Optional<Biome> snowy_coniferous_forest = Optional.absent();
|
|
||||||
public static Optional<Biome> snowy_forest = Optional.absent();
|
|
||||||
public static Optional<Biome> steppe = Optional.absent();
|
|
||||||
public static Optional<Biome> temperate_rainforest = Optional.absent();
|
|
||||||
public static Optional<Biome> tropical_rainforest = Optional.absent();
|
|
||||||
public static Optional<Biome> tundra = Optional.absent();
|
|
||||||
public static Optional<Biome> wasteland = Optional.absent();
|
|
||||||
public static Optional<Biome> wetland = Optional.absent();
|
|
||||||
public static Optional<Biome> woodland = Optional.absent();
|
|
||||||
public static Optional<Biome> xeric_shrubland = Optional.absent();
|
|
||||||
|
|
||||||
// edge-biomes, sub-biomes and mutated-biomes
|
|
||||||
public static Optional<Biome> alps_foothills = Optional.absent();
|
|
||||||
public static Optional<Biome> mountain_foothills = Optional.absent();
|
|
||||||
public static Optional<Biome> redwood_forest_edge = Optional.absent();
|
|
||||||
public static Optional<Biome> pasture = Optional.absent();
|
|
||||||
public static Optional<Biome> glacier = Optional.absent();
|
|
||||||
public static Optional<Biome> oasis = Optional.absent();
|
|
||||||
public static Optional<Biome> snowy_tundra = Optional.absent();
|
|
||||||
public static Optional<Biome> coral_reef = Optional.absent();
|
|
||||||
public static Optional<Biome> kelp_forest = Optional.absent();
|
|
||||||
public static Optional<Biome> origin_island = Optional.absent();
|
|
||||||
public static Optional<Biome> tropical_island = Optional.absent();
|
|
||||||
public static Optional<Biome> volcanic_island = Optional.absent();
|
|
||||||
public static Optional<Biome> flower_island = Optional.absent();
|
|
||||||
public static Optional<Biome> gravel_beach = Optional.absent();
|
|
||||||
public static Optional<Biome> white_beach = Optional.absent();
|
|
||||||
public static Optional<Biome> origin_beach = Optional.absent();
|
|
||||||
|
|
||||||
// nether biomes
|
|
||||||
public static Optional<Biome> corrupted_sands = Optional.absent();
|
|
||||||
public static Optional<Biome> fungi_forest = Optional.absent();
|
|
||||||
public static Optional<Biome> phantasmagoric_inferno = Optional.absent();
|
|
||||||
public static Optional<Biome> undergarden = Optional.absent();
|
|
||||||
public static Optional<Biome> visceral_heap = Optional.absent();
|
|
||||||
|
|
||||||
//Biome extensions
|
|
||||||
public static IExtendedBiome end_extension;
|
|
||||||
public static IExtendedBiome mushroom_island_extension;
|
|
||||||
public static IExtendedBiome plains_extension;
|
|
||||||
public static IExtendedBiome flower_forest_extension;
|
|
||||||
public static IExtendedBiome forest_extension;
|
|
||||||
public static IExtendedBiome forest_hills_extension;
|
|
||||||
public static IExtendedBiome jungle_extension;
|
|
||||||
public static IExtendedBiome jungle_hills_extension;
|
|
||||||
public static IExtendedBiome desert_extension;
|
|
||||||
public static IExtendedBiome desert_hills_extension;
|
|
||||||
public static IExtendedBiome taiga_extension;
|
|
||||||
public static IExtendedBiome taiga_hills_extension;
|
|
||||||
public static IExtendedBiome mesa_extension;
|
|
||||||
public static IExtendedBiome mesa_plateau_extension;
|
|
||||||
public static IExtendedBiome ice_plains_extension;
|
|
||||||
public static IExtendedBiome ice_mountains_extension;
|
|
||||||
public static IExtendedBiome extreme_hills_extension;
|
|
||||||
public static IExtendedBiome extreme_hills_plus_extension;
|
|
||||||
public static IExtendedBiome swampland_extension;
|
|
||||||
public static IExtendedBiome birch_forest_extension;
|
|
||||||
public static IExtendedBiome birch_forest_hills_extension;
|
|
||||||
public static IExtendedBiome roofed_forest_extension;
|
|
||||||
public static IExtendedBiome savanna_extension;
|
|
||||||
public static IExtendedBiome savanna_plateau_extension;
|
|
||||||
public static IExtendedBiome ocean_extension;
|
|
||||||
public static IExtendedBiome cold_taiga_extension;
|
|
||||||
public static IExtendedBiome cold_taiga_hills_extension;
|
|
||||||
public static IExtendedBiome mega_taiga_extension;
|
|
||||||
public static IExtendedBiome mega_taiga_hills_extension;
|
|
||||||
public static IExtendedBiome hell_extension;
|
|
||||||
public static IExtendedBiome beach_extension;
|
|
||||||
|
|
||||||
private static IBiomeRegistry createRegistry()
|
|
||||||
{
|
|
||||||
IBiomeRegistry instance = null;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
instance = (IBiomeRegistry)Class.forName("biomesoplenty.common.init.ModBiomes").newInstance();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface IBiomeRegistry
|
|
||||||
{
|
|
||||||
IExtendedBiome registerBiome(IExtendedBiome biome, String idName);
|
|
||||||
IExtendedBiome getExtendedBiome(Biome biome);
|
|
||||||
ImmutableSet<Biome> getPresentBiomes();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.biome;
|
|
||||||
|
|
||||||
public enum BiomeOwner
|
|
||||||
{
|
|
||||||
BIOMESOPLENTY, OTHER
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.biome;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import biomesoplenty.api.config.IBOPWorldSettings;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.api.generation.IGenerationManager;
|
|
||||||
import biomesoplenty.api.generation.IGenerator;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public interface IExtendedBiome
|
|
||||||
{
|
|
||||||
void applySettings(IBOPWorldSettings settings);
|
|
||||||
void configure(IConfigObj conf);
|
|
||||||
|
|
||||||
BiomeOwner getBiomeOwner();
|
|
||||||
void addGenerator(String name, GeneratorStage stage, IGenerator generator);
|
|
||||||
IGenerationManager getGenerationManager();
|
|
||||||
Map<BOPClimates, Integer> getWeightMap();
|
|
||||||
void clearWeights();
|
|
||||||
void addWeight(BOPClimates climate, int weight);
|
|
||||||
|
|
||||||
ResourceLocation getBeachLocation();
|
|
||||||
|
|
||||||
/**Get the base biome associated with this extension**/
|
|
||||||
Biome getBaseBiome();
|
|
||||||
ResourceLocation getResourceLocation();
|
|
||||||
}
|
|
|
@ -1,159 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.block;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraftforge.fluids.Fluid;
|
|
||||||
|
|
||||||
public class BOPBlocks
|
|
||||||
{
|
|
||||||
public static Block bamboo_thatching;
|
|
||||||
public static Block ash_block;
|
|
||||||
public static Block white_sand;
|
|
||||||
public static Block bamboo;
|
|
||||||
public static Block coral;
|
|
||||||
public static Block seaweed;
|
|
||||||
public static Block gem_block;
|
|
||||||
public static Block gem_ore;
|
|
||||||
public static Block hive;
|
|
||||||
public static Block mushroom;
|
|
||||||
public static Block white_sandstone;
|
|
||||||
public static Block biome_block;
|
|
||||||
|
|
||||||
public static Block blue_fire;
|
|
||||||
|
|
||||||
public static Block flower_0;
|
|
||||||
public static Block flower_1;
|
|
||||||
public static Block log_0;
|
|
||||||
public static Block log_1;
|
|
||||||
public static Block log_2;
|
|
||||||
public static Block log_3;
|
|
||||||
public static Block log_4;
|
|
||||||
public static Block leaves_0;
|
|
||||||
public static Block leaves_1;
|
|
||||||
public static Block leaves_2;
|
|
||||||
public static Block leaves_3;
|
|
||||||
public static Block leaves_4;
|
|
||||||
public static Block leaves_5;
|
|
||||||
public static Block leaves_6;
|
|
||||||
public static Block sapling_0;
|
|
||||||
public static Block sapling_1;
|
|
||||||
public static Block sapling_2;
|
|
||||||
// TODO fruit tree leaves and saplings
|
|
||||||
public static Block planks_0;
|
|
||||||
public static Block wood_slab_0;
|
|
||||||
public static Block wood_slab_1;
|
|
||||||
public static Block double_wood_slab_0;
|
|
||||||
public static Block double_wood_slab_1;
|
|
||||||
public static Block sacred_oak_stairs;
|
|
||||||
public static Block cherry_stairs;
|
|
||||||
public static Block umbran_stairs;
|
|
||||||
public static Block fir_stairs;
|
|
||||||
public static Block ethereal_stairs;
|
|
||||||
public static Block magic_stairs;
|
|
||||||
public static Block mangrove_stairs;
|
|
||||||
public static Block palm_stairs;
|
|
||||||
public static Block redwood_stairs;
|
|
||||||
public static Block willow_stairs;
|
|
||||||
public static Block pine_stairs;
|
|
||||||
public static Block hellbark_stairs;
|
|
||||||
public static Block jacaranda_stairs;
|
|
||||||
public static Block mahogany_stairs;
|
|
||||||
public static Block ebony_stairs;
|
|
||||||
public static Block eucalyptus_stairs;
|
|
||||||
public static Block sacred_oak_fence;
|
|
||||||
public static Block cherry_fence;
|
|
||||||
public static Block umbran_fence;
|
|
||||||
public static Block fir_fence;
|
|
||||||
public static Block ethereal_fence;
|
|
||||||
public static Block magic_fence;
|
|
||||||
public static Block mangrove_fence;
|
|
||||||
public static Block palm_fence;
|
|
||||||
public static Block redwood_fence;
|
|
||||||
public static Block willow_fence;
|
|
||||||
public static Block pine_fence;
|
|
||||||
public static Block hellbark_fence;
|
|
||||||
public static Block jacaranda_fence;
|
|
||||||
public static Block mahogany_fence;
|
|
||||||
public static Block ebony_fence;
|
|
||||||
public static Block eucalyptus_fence;
|
|
||||||
public static Block sacred_oak_fence_gate;
|
|
||||||
public static Block cherry_fence_gate;
|
|
||||||
public static Block umbran_fence_gate;
|
|
||||||
public static Block fir_fence_gate;
|
|
||||||
public static Block ethereal_fence_gate;
|
|
||||||
public static Block magic_fence_gate;
|
|
||||||
public static Block mangrove_fence_gate;
|
|
||||||
public static Block palm_fence_gate;
|
|
||||||
public static Block redwood_fence_gate;
|
|
||||||
public static Block willow_fence_gate;
|
|
||||||
public static Block pine_fence_gate;
|
|
||||||
public static Block hellbark_fence_gate;
|
|
||||||
public static Block jacaranda_fence_gate;
|
|
||||||
public static Block mahogany_fence_gate;
|
|
||||||
public static Block ebony_fence_gate;
|
|
||||||
public static Block eucalyptus_fence_gate;
|
|
||||||
public static Block sacred_oak_door;
|
|
||||||
public static Block cherry_door;
|
|
||||||
public static Block umbran_door;
|
|
||||||
public static Block fir_door;
|
|
||||||
public static Block ethereal_door;
|
|
||||||
public static Block magic_door;
|
|
||||||
public static Block mangrove_door;
|
|
||||||
public static Block palm_door;
|
|
||||||
public static Block redwood_door;
|
|
||||||
public static Block willow_door;
|
|
||||||
public static Block pine_door;
|
|
||||||
public static Block hellbark_door;
|
|
||||||
public static Block jacaranda_door;
|
|
||||||
public static Block mahogany_door;
|
|
||||||
public static Block ebony_door;
|
|
||||||
public static Block eucalyptus_door;
|
|
||||||
|
|
||||||
public static Block mud;
|
|
||||||
public static Block flesh;
|
|
||||||
public static Block grass;
|
|
||||||
public static Block grass_path;
|
|
||||||
public static Block waterlily;
|
|
||||||
public static Block dirt;
|
|
||||||
public static Block farmland_0;
|
|
||||||
public static Block farmland_1;
|
|
||||||
public static Block hard_ice;
|
|
||||||
public static Block dried_sand;
|
|
||||||
public static Block mud_brick_block;
|
|
||||||
public static Block crystal;
|
|
||||||
public static Block other_slab;
|
|
||||||
public static Block double_other_slab;
|
|
||||||
|
|
||||||
public static Block mud_brick_stairs;
|
|
||||||
public static Block white_sandstone_stairs;
|
|
||||||
|
|
||||||
public static Block ivy;
|
|
||||||
public static Block willow_vine;
|
|
||||||
|
|
||||||
public static Block plant_0;
|
|
||||||
public static Block plant_1;
|
|
||||||
public static Block double_plant;
|
|
||||||
|
|
||||||
public static Block bramble_plant;
|
|
||||||
|
|
||||||
public static Block honey_block;
|
|
||||||
public static Block terrarium;
|
|
||||||
|
|
||||||
public static Block sand;
|
|
||||||
public static Fluid sand_fluid;
|
|
||||||
public static Block honey;
|
|
||||||
public static Fluid honey_fluid;
|
|
||||||
public static Block blood;
|
|
||||||
public static Fluid blood_fluid;
|
|
||||||
public static Block poison;
|
|
||||||
public static Fluid poison_fluid;
|
|
||||||
public static Block hot_spring_water;
|
|
||||||
public static Fluid hot_spring_water_fluid;
|
|
||||||
}
|
|
|
@ -1,46 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.block;
|
|
||||||
|
|
||||||
public class BlockQueries
|
|
||||||
{
|
|
||||||
public static IBlockPosQuery anything;
|
|
||||||
public static IBlockPosQuery nothing;
|
|
||||||
public static IBlockPosQuery hasWater;
|
|
||||||
public static IBlockPosQuery airAbove;
|
|
||||||
public static IBlockPosQuery airBelow;
|
|
||||||
public static IBlockPosQuery waterCovered;
|
|
||||||
public static IBlockPosQuery breakable;
|
|
||||||
public static IBlockPosQuery air;
|
|
||||||
public static IBlockPosQuery airOrLeaves;
|
|
||||||
public static IBlockPosQuery surfaceBlocks;
|
|
||||||
public static IBlockPosQuery groundBlocks;
|
|
||||||
public static IBlockPosQuery solid;
|
|
||||||
public static IBlockPosQuery replaceable;
|
|
||||||
|
|
||||||
public static IBlockPosQuery fertile;
|
|
||||||
public static IBlockPosQuery fertileOrNetherrack;
|
|
||||||
public static IBlockPosQuery fertileOrSand;
|
|
||||||
public static IBlockPosQuery sustainsCave;
|
|
||||||
public static IBlockPosQuery sustainsNether;
|
|
||||||
public static IBlockPosQuery endish;
|
|
||||||
public static IBlockPosQuery hellish;
|
|
||||||
public static IBlockPosQuery litFertile;
|
|
||||||
public static IBlockPosQuery litBeach;
|
|
||||||
public static IBlockPosQuery litFertileWaterside;
|
|
||||||
public static IBlockPosQuery litSand;
|
|
||||||
public static IBlockPosQuery litDry;
|
|
||||||
public static IBlockPosQuery litDryWaterside;
|
|
||||||
public static IBlockPosQuery litFertileOrDry;
|
|
||||||
public static IBlockPosQuery spectralMoss;
|
|
||||||
public static IBlockPosQuery fertileSeaBed;
|
|
||||||
public static IBlockPosQuery underwater;
|
|
||||||
public static IBlockPosQuery suitableForReed;
|
|
||||||
public static IBlockPosQuery rootsCanDigThrough;
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2016, 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.api.block;
|
|
||||||
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
// for queries on a particular block position in the world
|
|
||||||
public interface IBlockPosQuery
|
|
||||||
{
|
|
||||||
boolean matches(World world, BlockPos pos);
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2016, 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.api.config;
|
|
||||||
|
|
||||||
public interface IBOPWorldSettings
|
|
||||||
{
|
|
||||||
boolean isEnabled(GeneratorType type);
|
|
||||||
|
|
||||||
enum GeneratorType
|
|
||||||
{
|
|
||||||
GEMS, POISON_IVY, BERRY_BUSHES, THORNS, QUICKSAND, LIQUID_POISON, HOT_SPRINGS,
|
|
||||||
NETHER_HIVES, END_FEATURES
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,79 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2016, 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.api.config;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import com.google.gson.JsonElement;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
|
|
||||||
public interface IConfigObj
|
|
||||||
{
|
|
||||||
JsonElement serializeDefaults();
|
|
||||||
void addMessage(String message);
|
|
||||||
void addMessage(String extraPrefix, String message);
|
|
||||||
List<String> flushMessages();
|
|
||||||
boolean isEmpty();
|
|
||||||
boolean has(String name);
|
|
||||||
Set<String> getKeys();
|
|
||||||
|
|
||||||
IConfigObj getObject(String name);
|
|
||||||
ArrayList<IConfigObj> getObjectArray(String name);
|
|
||||||
IConfigObj getObject(String name, boolean warnIfMissing);
|
|
||||||
ArrayList<IConfigObj> getObjectArray(String name, boolean warnIfMissing);
|
|
||||||
|
|
||||||
// Use the methods below when you want to obtain a value from a config file, if it is present, but you have a default value to use if it isn't
|
|
||||||
// No warning messages will be logged using these methods if the value is missing
|
|
||||||
Boolean getBool(String name, Boolean defaultVal);
|
|
||||||
String getString(String name, String defaultVal);
|
|
||||||
Integer getInt(String name, Integer defaultVal);
|
|
||||||
Float getFloat(String name, Float defaultVal);
|
|
||||||
IBlockState getBlockState(String name, IBlockState defaultVal);
|
|
||||||
IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal);
|
|
||||||
ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal);
|
|
||||||
<E extends Enum> E getEnum(String name, E defaultVal, Class<E> clazz);
|
|
||||||
|
|
||||||
// Use the methods below when you want to obtain a value from a config file which SHOULD be present
|
|
||||||
// If the value is missing, a warning message is logged, and null is returned
|
|
||||||
Boolean getBool(String name);
|
|
||||||
String getString(String name);
|
|
||||||
Integer getInt(String name);
|
|
||||||
Float getFloat(String name);
|
|
||||||
IBlockState getBlockState(String name);
|
|
||||||
IBlockPosQuery getBlockPosQuery(String name);
|
|
||||||
ResourceLocation getResourceLocation(String name);
|
|
||||||
<E extends Enum> E getEnum(String name, Class<E> clazz);
|
|
||||||
|
|
||||||
// Use the methods below when you want to obtain an array of values from a config file, if it is present, but you have a default value to use if it isn't
|
|
||||||
// No warning messages will be logged using these methods if the value is missing
|
|
||||||
ArrayList<Boolean> getBoolArray(String name, ArrayList<Boolean> defaultVal);
|
|
||||||
ArrayList<String> getStringArray(String name, ArrayList<String> defaultVal);
|
|
||||||
ArrayList<Integer> getIntArray(String name, ArrayList<Integer> defaultVal);
|
|
||||||
ArrayList<Float> getFloatArray(String name, ArrayList<Float> defaultVal);
|
|
||||||
ArrayList<IBlockState> getBlockStateArray(String name, ArrayList<IBlockState> defaultVal);
|
|
||||||
ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name, ArrayList<IBlockPosQuery> defaultVal);
|
|
||||||
ArrayList<ResourceLocation> getResourceLocationArray(String name, ArrayList<ResourceLocation> defaultVal);
|
|
||||||
<E extends Enum> ArrayList<E> getEnumArray(String name, ArrayList<E> defaultVal, Class<E> clazz);
|
|
||||||
|
|
||||||
// Use the methods below when you want to obtain an array of values from a config file which SHOULD be present
|
|
||||||
// If the value is missing, a warning message is logged, and null is returned
|
|
||||||
ArrayList<Boolean> getBoolArray(String name);
|
|
||||||
ArrayList<String> getStringArray(String name);
|
|
||||||
ArrayList<Integer> getIntArray(String name);
|
|
||||||
ArrayList<Float> getFloatArray(String name);
|
|
||||||
ArrayList<IBlockState> getBlockStateArray(String name);
|
|
||||||
ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name);
|
|
||||||
ArrayList<ResourceLocation> getResourceLocationArray(String name);
|
|
||||||
<E extends Enum> ArrayList<E> getEnumArray(String name, Class<E> clazz);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,146 +0,0 @@
|
||||||
package biomesoplenty.api.enums;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import biomesoplenty.api.generation.BOPGenLayer;
|
|
||||||
import net.minecraft.init.Biomes;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
import net.minecraftforge.common.BiomeManager.BiomeType;
|
|
||||||
|
|
||||||
public enum BOPClimates {
|
|
||||||
|
|
||||||
ICE_CAP (BiomeType.ICY),
|
|
||||||
TUNDRA (BiomeType.ICY),
|
|
||||||
BOREAL (BiomeType.COOL),
|
|
||||||
COLD_SWAMP (BiomeType.COOL),
|
|
||||||
WET_TEMPERATE (BiomeType.WARM),
|
|
||||||
DRY_TEMPERATE (BiomeType.WARM),
|
|
||||||
COOL_TEMPERATE (BiomeType.COOL),
|
|
||||||
WARM_TEMPERATE (BiomeType.WARM),
|
|
||||||
HOT_SWAMP (BiomeType.WARM),
|
|
||||||
TROPICAL (BiomeType.DESERT),
|
|
||||||
MEDITERANEAN (BiomeType.WARM),
|
|
||||||
SAVANNA (BiomeType.DESERT),
|
|
||||||
HOT_DESERT (BiomeType.DESERT),
|
|
||||||
WASTELAND (BiomeType.DESERT),
|
|
||||||
HELL (null);
|
|
||||||
|
|
||||||
public final BiomeType biomeType;
|
|
||||||
private int totalBiomesWeight;
|
|
||||||
|
|
||||||
private ArrayList<WeightedBiomeEntry> landBiomes = new ArrayList<WeightedBiomeEntry>();
|
|
||||||
|
|
||||||
BOPClimates(BiomeType biomeType)
|
|
||||||
{
|
|
||||||
this.biomeType = biomeType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BOPClimates addBiome(int weight, Biome biome)
|
|
||||||
{
|
|
||||||
return this.addBiome(new WeightedBiomeEntry(weight, biome));
|
|
||||||
}
|
|
||||||
|
|
||||||
public BOPClimates addBiome(WeightedBiomeEntry biomeEntry)
|
|
||||||
{
|
|
||||||
this.totalBiomesWeight += biomeEntry.weight;
|
|
||||||
this.landBiomes.add(biomeEntry);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Biome getRandomBiome(BOPGenLayer layer)
|
|
||||||
{
|
|
||||||
int weight = layer.nextInt(this.totalBiomesWeight);
|
|
||||||
Iterator<WeightedBiomeEntry> iterator = this.landBiomes.iterator();
|
|
||||||
WeightedBiomeEntry item;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
item = iterator.next();
|
|
||||||
weight -= item.weight;
|
|
||||||
}
|
|
||||||
while (weight >= 0);
|
|
||||||
return item.biome;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Biome getRandomOceanBiome(BOPGenLayer layer, boolean deep)
|
|
||||||
{
|
|
||||||
return (deep ? Biomes.DEEP_OCEAN : Biomes.OCEAN);
|
|
||||||
}
|
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
// set up vanilla biomes
|
|
||||||
|
|
||||||
BOPClimates.ICE_CAP.addBiome(10,Biomes.ICE_PLAINS);
|
|
||||||
BOPClimates.TUNDRA.addBiome(10, Biomes.COLD_TAIGA).addBiome(10, Biomes.EXTREME_HILLS);
|
|
||||||
BOPClimates.BOREAL.addBiome(5, Biomes.REDWOOD_TAIGA).addBiome(5, Biomes.EXTREME_HILLS).addBiome(20, Biomes.TAIGA);
|
|
||||||
BOPClimates.COLD_SWAMP.addBiome(5, Biomes.SWAMPLAND);
|
|
||||||
BOPClimates.WET_TEMPERATE.addBiome(20, Biomes.ROOFED_FOREST).addBiome(5, Biomes.FOREST);
|
|
||||||
BOPClimates.DRY_TEMPERATE.addBiome(5, Biomes.PLAINS);
|
|
||||||
BOPClimates.COOL_TEMPERATE.addBiome(15, Biomes.FOREST).addBiome(10, Biomes.BIRCH_FOREST);
|
|
||||||
BOPClimates.WARM_TEMPERATE.addBiome(20, Biomes.PLAINS).addBiome(5, Biomes.BIRCH_FOREST);
|
|
||||||
BOPClimates.HOT_SWAMP.addBiome(5, Biomes.SWAMPLAND);
|
|
||||||
BOPClimates.TROPICAL.addBiome(15, Biomes.JUNGLE);
|
|
||||||
BOPClimates.MEDITERANEAN.addBiome(5, Biomes.PLAINS);
|
|
||||||
BOPClimates.SAVANNA.addBiome(20, Biomes.SAVANNA);
|
|
||||||
BOPClimates.HOT_DESERT.addBiome(30, Biomes.DESERT).addBiome(15, Biomes.MESA_CLEAR_ROCK);
|
|
||||||
BOPClimates.WASTELAND.addBiome(1, Biomes.DESERT);
|
|
||||||
BOPClimates.HELL.addBiome(30, Biomes.HELL);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static BOPClimates[] values = BOPClimates.values();
|
|
||||||
|
|
||||||
public static BOPClimates lookup(int i) {return values[i];}
|
|
||||||
|
|
||||||
// map temperature and rainfall to climates
|
|
||||||
// temperature values from 0 (cold) to 8 (hot) and rainfall values from 0 (wet) to 11 (dry), index is (temperatureValue * 12) + rainfallValue
|
|
||||||
// we will contrive to make any combination equally likely, so the overall rarity of each climate is in proportion to the number of times it appears in the array
|
|
||||||
private static final BOPClimates[] climateMapping = new BOPClimates[] {
|
|
||||||
// 0 1 2 3 4 5 6 7 8 9 10 11
|
|
||||||
TUNDRA, TUNDRA, TUNDRA, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, // 0
|
|
||||||
BOREAL, BOREAL, BOREAL, TUNDRA, TUNDRA, TUNDRA, TUNDRA, TUNDRA, TUNDRA, TUNDRA, TUNDRA, TUNDRA, // 1
|
|
||||||
COLD_SWAMP, COLD_SWAMP, COLD_SWAMP, BOREAL, BOREAL, BOREAL, BOREAL, BOREAL, BOREAL, BOREAL, BOREAL, BOREAL, // 2
|
|
||||||
COLD_SWAMP, COLD_SWAMP, COLD_SWAMP, WET_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, DRY_TEMPERATE, DRY_TEMPERATE, DRY_TEMPERATE, // 3
|
|
||||||
COLD_SWAMP, WET_TEMPERATE, WET_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, DRY_TEMPERATE, DRY_TEMPERATE, DRY_TEMPERATE, DRY_TEMPERATE, // 4
|
|
||||||
WET_TEMPERATE, WET_TEMPERATE, WET_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, DRY_TEMPERATE, SAVANNA, SAVANNA, // 5
|
|
||||||
HOT_SWAMP, HOT_SWAMP, HOT_SWAMP, WET_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, MEDITERANEAN, MEDITERANEAN, SAVANNA, HOT_DESERT, HOT_DESERT, // 6
|
|
||||||
TROPICAL, TROPICAL, HOT_SWAMP, HOT_SWAMP, WET_TEMPERATE, WARM_TEMPERATE, MEDITERANEAN, MEDITERANEAN, SAVANNA, HOT_DESERT, HOT_DESERT, WASTELAND, // 7
|
|
||||||
TROPICAL, TROPICAL, TROPICAL, HOT_SWAMP, HOT_SWAMP, MEDITERANEAN, MEDITERANEAN, SAVANNA, HOT_DESERT, HOT_DESERT, WASTELAND, WASTELAND // 8
|
|
||||||
};
|
|
||||||
|
|
||||||
public static int[] getClimateMappingInts()
|
|
||||||
{
|
|
||||||
// 9 temperature values, 12 rainfall values, 12 * 9 = 108
|
|
||||||
int[] out = new int[108];
|
|
||||||
for (int i = 0; i < 108; i++)
|
|
||||||
{
|
|
||||||
out[i] = climateMapping[i].ordinal();
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class WeightedBiomeEntry
|
|
||||||
{
|
|
||||||
public final int weight;
|
|
||||||
public final Biome biome;
|
|
||||||
|
|
||||||
public WeightedBiomeEntry(int weight, Biome biome)
|
|
||||||
{
|
|
||||||
this.weight = weight;
|
|
||||||
this.biome = biome;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// for debugging purposes
|
|
||||||
public static void printWeights()
|
|
||||||
{
|
|
||||||
for (BOPClimates climate : BOPClimates.values())
|
|
||||||
{
|
|
||||||
for (WeightedBiomeEntry entry : climate.landBiomes)
|
|
||||||
{
|
|
||||||
System.out.println(climate.name()+" "+entry.biome.getBiomeName()+" "+entry.weight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.enums;
|
|
||||||
|
|
||||||
import net.minecraft.util.IStringSerializable;
|
|
||||||
|
|
||||||
public enum BOPFlowers implements IStringSerializable, IPagedVariants
|
|
||||||
{
|
|
||||||
CLOVER, SWAMPFLOWER, DEATHBLOOM, GLOWFLOWER, BLUE_HYDRANGEA, ORANGE_COSMOS, PINK_DAFFODIL, WILDFLOWER, VIOLET, WHITE_ANEMONE, ENDERLOTUS, BROMELIAD, WILTED_LILY, PINK_HIBISCUS, LILY_OF_THE_VALLEY, BURNING_BLOSSOM, LAVENDER, GOLDENROD, BLUEBELLS, MINERS_DELIGHT, ICY_IRIS, ROSE;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return this.name().toLowerCase();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return this.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.enums;
|
|
||||||
|
|
||||||
import net.minecraft.util.IStringSerializable;
|
|
||||||
|
|
||||||
public enum BOPGems implements IStringSerializable
|
|
||||||
{
|
|
||||||
AMETHYST, RUBY, PERIDOT, TOPAZ, TANZANITE, MALACHITE, SAPPHIRE, AMBER;
|
|
||||||
@Override
|
|
||||||
public String getName()
|
|
||||||
{
|
|
||||||
return this.name().toLowerCase();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return this.getName();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.enums;
|
|
||||||
|
|
||||||
import net.minecraft.util.IStringSerializable;
|
|
||||||
|
|
||||||
public enum BOPPlants implements IStringSerializable, IPagedVariants
|
|
||||||
{
|
|
||||||
|
|
||||||
SHORTGRASS, MEDIUMGRASS, BUSH, SPROUT, POISONIVY, BERRYBUSH, SHRUB, WHEATGRASS, DAMPGRASS, KORU, CLOVERPATCH, LEAFPILE, DEADLEAFPILE, DEADGRASS, DESERTGRASS, DESERTSPROUTS, DUNEGRASS, SPECTRALFERN, THORN, WILDRICE, CATTAIL, RIVERCANE, TINYCACTUS, DEVILWEED, REED, ROOT, RAFFLESIA, BARLEY;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return this.name().toLowerCase();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return this.getName();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,46 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.enums;
|
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
|
||||||
|
|
||||||
import net.minecraft.util.IStringSerializable;
|
|
||||||
|
|
||||||
public enum BOPTrees implements IStringSerializable, IPagedVariants
|
|
||||||
{
|
|
||||||
|
|
||||||
YELLOW_AUTUMN, ORANGE_AUTUMN, BAMBOO, MAGIC, UMBRAN, DEAD, FIR, ETHEREAL, ORIGIN, PINK_CHERRY, WHITE_CHERRY, MAPLE, HELLBARK, FLOWERING, JACARANDA, SACRED_OAK, MANGROVE, PALM, REDWOOD, WILLOW, PINE, MAHOGANY, EBONY, EUCALYPTUS, RED_BIG_FLOWER, YELLOW_BIG_FLOWER;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return this.name().toLowerCase();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return this.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasSapling()
|
|
||||||
{
|
|
||||||
switch(this)
|
|
||||||
{
|
|
||||||
case YELLOW_BIG_FLOWER: case RED_BIG_FLOWER:
|
|
||||||
return false;
|
|
||||||
default:
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Predicate withSaplings = new Predicate<BOPTrees>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean apply(BOPTrees tree) {return tree.hasSapling();}
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.enums;
|
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
|
||||||
|
|
||||||
import net.minecraft.util.IStringSerializable;
|
|
||||||
|
|
||||||
public enum BOPWoods implements IStringSerializable, IPagedVariants
|
|
||||||
{
|
|
||||||
|
|
||||||
SACRED_OAK, CHERRY, UMBRAN, FIR, ETHEREAL, MAGIC, MANGROVE, PALM, REDWOOD, WILLOW, PINE, HELLBARK, JACARANDA, MAHOGANY, EBONY, EUCALYPTUS, GIANT_FLOWER, DEAD;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return this.name().toLowerCase();
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return this.getName();
|
|
||||||
}
|
|
||||||
public boolean hasPlanks()
|
|
||||||
{
|
|
||||||
switch (this) {
|
|
||||||
case GIANT_FLOWER: case DEAD:
|
|
||||||
return false;
|
|
||||||
default:
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public boolean canMakeCharcoal()
|
|
||||||
{
|
|
||||||
switch (this) {
|
|
||||||
case GIANT_FLOWER:
|
|
||||||
return false;
|
|
||||||
default:
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Predicate withPlanks = new Predicate<BOPWoods>()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean apply(BOPWoods wood) {return wood.hasPlanks();}
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
package biomesoplenty.api.enums;
|
|
||||||
|
|
||||||
public interface IPagedVariants {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.api.generation;
|
|
||||||
import net.minecraft.world.gen.layer.GenLayer;
|
|
||||||
|
|
||||||
public abstract class BOPGenLayer extends GenLayer
|
|
||||||
{
|
|
||||||
public BOPGenLayer(long seed) {
|
|
||||||
super(seed);
|
|
||||||
}
|
|
||||||
|
|
||||||
// make nextInt public
|
|
||||||
@Override
|
|
||||||
public int nextInt(int a)
|
|
||||||
{
|
|
||||||
return super.nextInt(a);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,98 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.api.generation;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
|
||||||
|
|
||||||
public abstract class BOPGeneratorBase extends WorldGenerator implements IGenerator
|
|
||||||
{
|
|
||||||
protected final String identifier;
|
|
||||||
protected String name;
|
|
||||||
protected GeneratorStage stage;
|
|
||||||
protected float amountPerChunk;
|
|
||||||
|
|
||||||
protected BOPGeneratorBase(float amountPerChunk)
|
|
||||||
{
|
|
||||||
this.identifier = Generators.registry.getIdentifier(this.getClass());
|
|
||||||
|
|
||||||
if (this.identifier == null)
|
|
||||||
{
|
|
||||||
throw new RuntimeException("The identifier for " + this.getClass().getCanonicalName() + " cannot be null!");
|
|
||||||
}
|
|
||||||
|
|
||||||
this.amountPerChunk = amountPerChunk;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected static abstract class InnerBuilder<T extends InnerBuilder<T, G>, G extends BOPGeneratorBase>
|
|
||||||
{
|
|
||||||
protected T self() {return (T)this;}
|
|
||||||
protected float amountPerChunk;
|
|
||||||
public T amountPerChunk(float amountPerChunk) {this.amountPerChunk = amountPerChunk; return this.self();}
|
|
||||||
public abstract G create();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setName(String name)
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setStage(GeneratorStage stage)
|
|
||||||
{
|
|
||||||
this.stage = stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName()
|
|
||||||
{
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GeneratorStage getStage()
|
|
||||||
{
|
|
||||||
return this.stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public final String getIdentifier()
|
|
||||||
{
|
|
||||||
return this.identifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract BlockPos getScatterY(World world, Random random, int x, int z);
|
|
||||||
|
|
||||||
public int getAmountToScatter(Random random)
|
|
||||||
{
|
|
||||||
int amount = MathHelper.floor(this.amountPerChunk);
|
|
||||||
float remainder = this.amountPerChunk - amount;
|
|
||||||
if (random.nextFloat() < remainder) {amount++;}
|
|
||||||
return amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void scatter(World world, Random random, BlockPos pos)
|
|
||||||
{
|
|
||||||
int amount = this.getAmountToScatter(random);
|
|
||||||
for (int i = 0; i < amount; i++)
|
|
||||||
{
|
|
||||||
int x = pos.getX() + random.nextInt(16) + 8;
|
|
||||||
int z = pos.getZ() + random.nextInt(16) + 8;
|
|
||||||
generate(world, random, this.getScatterY(world, random, x, z));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,110 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.api.generation;
|
|
||||||
|
|
||||||
import java.util.EnumMap;
|
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate;
|
|
||||||
|
|
||||||
public enum GeneratorStage
|
|
||||||
{
|
|
||||||
@SerializedName("pre")
|
|
||||||
PRE(null),
|
|
||||||
@SerializedName("big_shroom")
|
|
||||||
BIG_SHROOM(Decorate.EventType.BIG_SHROOM),
|
|
||||||
@SerializedName("cactus")
|
|
||||||
CACTUS(Decorate.EventType.CACTUS),
|
|
||||||
@SerializedName("clay")
|
|
||||||
CLAY(Decorate.EventType.CLAY),
|
|
||||||
@SerializedName("dead_bush")
|
|
||||||
DEAD_BUSH(Decorate.EventType.DEAD_BUSH),
|
|
||||||
@SerializedName("desert_well")
|
|
||||||
DESERT_WELL(Decorate.EventType.DESERT_WELL),
|
|
||||||
@SerializedName("lilypad")
|
|
||||||
LILYPAD(Decorate.EventType.LILYPAD),
|
|
||||||
@SerializedName("flowers")
|
|
||||||
FLOWERS(Decorate.EventType.FLOWERS),
|
|
||||||
@SerializedName("fossil")
|
|
||||||
FOSSIL(Decorate.EventType.FOSSIL),
|
|
||||||
@SerializedName("grass")
|
|
||||||
GRASS(Decorate.EventType.GRASS),
|
|
||||||
@SerializedName("ice")
|
|
||||||
ICE(Decorate.EventType.ICE),
|
|
||||||
@SerializedName("lake_water")
|
|
||||||
LAKE_WATER(Decorate.EventType.LAKE_WATER),
|
|
||||||
@SerializedName("lake_lava")
|
|
||||||
LAKE_LAVA(Decorate.EventType.LAKE_LAVA),
|
|
||||||
@SerializedName("pumpkin")
|
|
||||||
PUMPKIN(Decorate.EventType.PUMPKIN),
|
|
||||||
@SerializedName("reed")
|
|
||||||
REED(Decorate.EventType.REED),
|
|
||||||
@SerializedName("rock")
|
|
||||||
ROCK(Decorate.EventType.ROCK),
|
|
||||||
@SerializedName("sand")
|
|
||||||
SAND(Decorate.EventType.SAND),
|
|
||||||
@SerializedName("sand_pass_2")
|
|
||||||
SAND_PASS2(Decorate.EventType.SAND_PASS2),
|
|
||||||
@SerializedName("shroom")
|
|
||||||
SHROOM(Decorate.EventType.SHROOM),
|
|
||||||
@SerializedName("tree")
|
|
||||||
TREE(Decorate.EventType.TREE),
|
|
||||||
@SerializedName("post")
|
|
||||||
POST(null),
|
|
||||||
@SerializedName("parent")
|
|
||||||
PARENT(null),
|
|
||||||
@SerializedName("ore_pre")
|
|
||||||
ORE_PRE(null),
|
|
||||||
@SerializedName("ore_post")
|
|
||||||
ORE_POST(null);
|
|
||||||
|
|
||||||
private Decorate.EventType decorateType;
|
|
||||||
|
|
||||||
GeneratorStage(Decorate.EventType decorateType)
|
|
||||||
{
|
|
||||||
this.decorateType = decorateType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Decorate.EventType getDecorateType()
|
|
||||||
{
|
|
||||||
return this.decorateType;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final EnumMap<Decorate.EventType, GeneratorStage> decorateTypeMapper = Maps.newEnumMap(Decorate.EventType.class);
|
|
||||||
static
|
|
||||||
{
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.BIG_SHROOM, BIG_SHROOM);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.CACTUS, CACTUS);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.CLAY, CLAY);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.DEAD_BUSH, DEAD_BUSH);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.DESERT_WELL, DESERT_WELL);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.LILYPAD, LILYPAD);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.FLOWERS, FLOWERS);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.FOSSIL, FOSSIL);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.GRASS, GRASS);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.ICE, ICE);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.LAKE_WATER, LAKE_WATER);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.LAKE_LAVA, LAKE_LAVA);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.PUMPKIN, PUMPKIN);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.REED, REED);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.ROCK, ROCK);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.SAND, SAND);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.SAND_PASS2, SAND_PASS2);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.SHROOM, SHROOM);
|
|
||||||
decorateTypeMapper.put(Decorate.EventType.TREE, TREE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static GeneratorStage mapDecorateType(Decorate.EventType decorateType)
|
|
||||||
{
|
|
||||||
//Somewhat of a hack, requires the ordering of our enum to be the same as the decorate event
|
|
||||||
return decorateType != Decorate.EventType.CUSTOM ? decorateTypeMapper.get(decorateType) : null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2016, 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.api.generation;
|
|
||||||
|
|
||||||
import net.minecraft.world.gen.layer.GenLayer;
|
|
||||||
|
|
||||||
public class Generators
|
|
||||||
{
|
|
||||||
public static IGeneratorRegistry registry;
|
|
||||||
|
|
||||||
public static GenLayer biomeGenLayer;
|
|
||||||
public static GenLayer biomeIndexLayer;
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2016, 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.api.generation;
|
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableCollection;
|
|
||||||
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
|
|
||||||
public interface IGenerationManager
|
|
||||||
{
|
|
||||||
void addGenerator(String name, GeneratorStage stage, IGenerator generator);
|
|
||||||
ImmutableCollection<IGenerator> getGeneratorsForStage(GeneratorStage stage);
|
|
||||||
void removeGenerator(String name);
|
|
||||||
IGenerator getGenerator(String name);
|
|
||||||
void configure(IConfigObj conf);
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.generation;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public interface IGenerator
|
|
||||||
{
|
|
||||||
void scatter(World world, Random random, BlockPos pos);
|
|
||||||
boolean generate(World world, Random random, BlockPos pos);
|
|
||||||
|
|
||||||
void setStage(GeneratorStage stage);
|
|
||||||
void setName(String name);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A unique name used to classify the purpose of a generator. For example, emeralds and ruby use the
|
|
||||||
* same generator (and thus, have the same identifier) but have differing names.
|
|
||||||
*/
|
|
||||||
String getName();
|
|
||||||
/**The identifier for this generator should be consistent across all instances of the same type*/
|
|
||||||
String getIdentifier();
|
|
||||||
GeneratorStage getStage();
|
|
||||||
|
|
||||||
interface IGeneratorBuilder<T extends IGenerator>
|
|
||||||
{
|
|
||||||
T create();
|
|
||||||
}
|
|
||||||
|
|
||||||
void configure(IConfigObj conf);
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2016, 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.api.generation;
|
|
||||||
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
|
|
||||||
public interface IGeneratorRegistry
|
|
||||||
{
|
|
||||||
<T extends IGenerator> void registerGenerator(String identifier, Class<T> generatorClass, IGenerator.IGeneratorBuilder<T> builder);
|
|
||||||
String getIdentifier(Class<? extends IGenerator> generatorClass);
|
|
||||||
Class<? extends IGenerator> getGeneratorClass(String identifier);
|
|
||||||
IGenerator.IGeneratorBuilder<?> getGeneratorBuilder(String identifier);
|
|
||||||
boolean generatorExists(String identifier);
|
|
||||||
IGenerator createGenerator(IConfigObj conf);
|
|
||||||
}
|
|
|
@ -1,88 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.item;
|
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
|
|
||||||
public class BOPItems
|
|
||||||
{
|
|
||||||
|
|
||||||
public static Item berries;
|
|
||||||
public static Item shroompowder;
|
|
||||||
public static Item peach;
|
|
||||||
public static Item earth;
|
|
||||||
public static Item persimmon;
|
|
||||||
public static Item filled_honeycomb;
|
|
||||||
public static Item pear;
|
|
||||||
public static Item ricebowl;
|
|
||||||
|
|
||||||
public static Item fleshchunk;
|
|
||||||
public static Item mudball;
|
|
||||||
public static Item crystal_shard;
|
|
||||||
public static Item terrestrial_artifact;
|
|
||||||
public static Item honeycomb;
|
|
||||||
public static Item gem;
|
|
||||||
public static Item ash;
|
|
||||||
public static Item mud_brick;
|
|
||||||
public static Item blue_dye;
|
|
||||||
public static Item brown_dye;
|
|
||||||
public static Item green_dye;
|
|
||||||
public static Item white_dye;
|
|
||||||
public static Item black_dye;
|
|
||||||
public static Item other_slab;
|
|
||||||
|
|
||||||
public static Item boat_sacred_oak;
|
|
||||||
public static Item boat_cherry;
|
|
||||||
public static Item boat_umbran;
|
|
||||||
public static Item boat_fir;
|
|
||||||
public static Item boat_ethereal;
|
|
||||||
public static Item boat_magic;
|
|
||||||
public static Item boat_mangrove;
|
|
||||||
public static Item boat_palm;
|
|
||||||
public static Item boat_redwood;
|
|
||||||
public static Item boat_willow;
|
|
||||||
public static Item boat_pine;
|
|
||||||
public static Item boat_hellbark;
|
|
||||||
public static Item boat_jacaranda;
|
|
||||||
public static Item boat_mahogany;
|
|
||||||
public static Item boat_ebony;
|
|
||||||
public static Item boat_eucalyptus;
|
|
||||||
|
|
||||||
public static Item sacred_oak_door;
|
|
||||||
public static Item cherry_door;
|
|
||||||
public static Item umbran_door;
|
|
||||||
public static Item fir_door;
|
|
||||||
public static Item ethereal_door;
|
|
||||||
public static Item magic_door;
|
|
||||||
public static Item mangrove_door;
|
|
||||||
public static Item palm_door;
|
|
||||||
public static Item redwood_door;
|
|
||||||
public static Item willow_door;
|
|
||||||
public static Item pine_door;
|
|
||||||
public static Item hellbark_door;
|
|
||||||
public static Item jacaranda_door;
|
|
||||||
public static Item mahogany_door;
|
|
||||||
public static Item ebony_door;
|
|
||||||
public static Item eucalyptus_door;
|
|
||||||
|
|
||||||
public static Item wood_slab_0;
|
|
||||||
public static Item wood_slab_1;
|
|
||||||
|
|
||||||
public static Item biome_finder;
|
|
||||||
public static Item biome_essence;
|
|
||||||
public static Item jar_empty;
|
|
||||||
public static Item jar_filled;
|
|
||||||
|
|
||||||
public static Item record_wanderer;
|
|
||||||
|
|
||||||
// TODO: public static Item ancientStaff;
|
|
||||||
// TODO: public static Item bop_bucket;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
package biomesoplenty.api.particle;
|
|
||||||
|
|
||||||
public enum BOPParticleTypes
|
|
||||||
{
|
|
||||||
MUD, PLAYER_TRAIL, CURSE
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.api.potion;
|
|
||||||
|
|
||||||
import net.minecraft.potion.Potion;
|
|
||||||
|
|
||||||
public class BOPPotions
|
|
||||||
{
|
|
||||||
public static Potion curse;
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2016, 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.api.sound;
|
|
||||||
|
|
||||||
import net.minecraft.util.SoundEvent;
|
|
||||||
|
|
||||||
public class BOPSounds
|
|
||||||
{
|
|
||||||
public static SoundEvent wasp_ambient;
|
|
||||||
public static SoundEvent wasp_hurt;
|
|
||||||
public static SoundEvent records_wanderer;
|
|
||||||
}
|
|
|
@ -1,641 +0,0 @@
|
||||||
package biomesoplenty.client.gui;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
|
||||||
import com.google.common.primitives.Floats;
|
|
||||||
|
|
||||||
import biomesoplenty.common.world.BOPWorldSettings;
|
|
||||||
import biomesoplenty.common.world.BOPWorldSettings.BiomeSize;
|
|
||||||
import biomesoplenty.common.world.BOPWorldSettings.LandMassScheme;
|
|
||||||
import biomesoplenty.common.world.BOPWorldSettings.RainfallVariationScheme;
|
|
||||||
import biomesoplenty.common.world.BOPWorldSettings.TemperatureVariationScheme;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.client.gui.GuiCreateWorld;
|
|
||||||
import net.minecraft.client.gui.GuiListButton;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
import net.minecraft.client.gui.GuiSlider;
|
|
||||||
import net.minecraft.client.gui.GuiTextField;
|
|
||||||
import net.minecraft.client.renderer.BufferBuilder;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|
||||||
import net.minecraft.client.resources.I18n;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatHelper, GuiBOPPageList.GuiResponder
|
|
||||||
{
|
|
||||||
private GuiCreateWorld parentScreen;
|
|
||||||
|
|
||||||
protected String screenTitle = "Customize World Settings";
|
|
||||||
protected String pageInfo = "Page 1 of 3";
|
|
||||||
protected String page0Title = "Basic Settings";
|
|
||||||
protected String[] pageNames;
|
|
||||||
|
|
||||||
private GuiBOPPageManager pageManager;
|
|
||||||
|
|
||||||
//Navigation buttons, required on all pages
|
|
||||||
private GuiButton doneButton;
|
|
||||||
private GuiButton defaultsButton;
|
|
||||||
private GuiButton prevButton;
|
|
||||||
private GuiButton nextButton;
|
|
||||||
private GuiButton yesButton;
|
|
||||||
private GuiButton noButton;
|
|
||||||
|
|
||||||
private int modalAction = 0;
|
|
||||||
private boolean field_175340_C = false;
|
|
||||||
private Predicate validFloatPredicate = new Predicate()
|
|
||||||
{
|
|
||||||
public boolean tryParseValidFloat(String p_178956_1_)
|
|
||||||
{
|
|
||||||
Float f = Floats.tryParse(p_178956_1_);
|
|
||||||
return p_178956_1_.length() == 0 || f != null && Floats.isFinite(f.floatValue()) && f.floatValue() >= 0.0F;
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public boolean apply(Object p_apply_1_)
|
|
||||||
{
|
|
||||||
return this.tryParseValidFloat((String)p_apply_1_);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private BOPWorldSettings settings;
|
|
||||||
|
|
||||||
|
|
||||||
public GuiBOPConfigureWorld(GuiScreen parentScreen, String settingsStringIn)
|
|
||||||
{
|
|
||||||
this.parentScreen = (GuiCreateWorld)parentScreen;
|
|
||||||
|
|
||||||
if (settingsStringIn.isEmpty())
|
|
||||||
{
|
|
||||||
this.settings = new BOPWorldSettings();
|
|
||||||
} else {
|
|
||||||
this.settings = new BOPWorldSettings(settingsStringIn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private enum Actions
|
|
||||||
{
|
|
||||||
PREVIOUS (301),
|
|
||||||
NEXT (302),
|
|
||||||
DEFAULTS (303),
|
|
||||||
DONE (304),
|
|
||||||
YES (305),
|
|
||||||
NO (306);
|
|
||||||
|
|
||||||
private int id;
|
|
||||||
|
|
||||||
Actions(int id)
|
|
||||||
{
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
public int getId()
|
|
||||||
{
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Actions fromId(int id)
|
|
||||||
{
|
|
||||||
for (Actions action : Actions.values())
|
|
||||||
{
|
|
||||||
if (action.id == id)
|
|
||||||
{
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void initGui()
|
|
||||||
{
|
|
||||||
this.screenTitle = I18n.format("options.customizeTitle");
|
|
||||||
|
|
||||||
this.buttonList.clear();
|
|
||||||
this.buttonList.add(this.prevButton = new GuiButton(Actions.PREVIOUS.getId(), 20, 5, 80, 20, I18n.format("createWorld.customize.custom.prev")));
|
|
||||||
this.buttonList.add(this.nextButton = new GuiButton(Actions.NEXT.getId(), this.width - 100, 5, 80, 20, I18n.format("createWorld.customize.custom.next")));
|
|
||||||
this.buttonList.add(this.defaultsButton = new GuiButton(Actions.DEFAULTS.getId(), this.width / 2 - 187, this.height - 27, 90, 20, I18n.format("createWorld.customize.custom.defaults")));
|
|
||||||
this.buttonList.add(this.doneButton = new GuiButton(Actions.DONE.getId(), this.width / 2 + 98, this.height - 27, 90, 20, I18n.format("gui.done")));
|
|
||||||
|
|
||||||
this.yesButton = new GuiButton(Actions.YES.getId(), this.width / 2 - 55, 160, 50, 20, I18n.format("gui.yes"));
|
|
||||||
this.yesButton.visible = false;
|
|
||||||
this.buttonList.add(this.yesButton);
|
|
||||||
|
|
||||||
this.noButton = new GuiButton(Actions.NO.getId(), this.width / 2 + 5, 160, 50, 20, I18n.format("gui.no"));
|
|
||||||
this.noButton.visible = false;
|
|
||||||
this.buttonList.add(this.noButton);
|
|
||||||
|
|
||||||
this.setupPages();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleMouseInput() throws IOException
|
|
||||||
{
|
|
||||||
super.handleMouseInput();
|
|
||||||
this.pageManager.getActivePage().handleMouseInput();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
|
|
||||||
{
|
|
||||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
|
||||||
|
|
||||||
if (this.modalAction == 0 && !this.field_175340_C)
|
|
||||||
{
|
|
||||||
this.pageManager.getActivePage().mouseClicked(mouseX, mouseY, mouseButton);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void mouseReleased(int mouseX, int mouseY, int state)
|
|
||||||
{
|
|
||||||
super.mouseReleased(mouseX, mouseY, state);
|
|
||||||
|
|
||||||
if (this.field_175340_C)
|
|
||||||
{
|
|
||||||
this.field_175340_C = false;
|
|
||||||
}
|
|
||||||
else if (this.modalAction == 0)
|
|
||||||
{
|
|
||||||
this.pageManager.getActivePage().mouseReleased(mouseX, mouseY, state);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private enum GuiEntries
|
|
||||||
{
|
|
||||||
TEMP_SCHEME (101),
|
|
||||||
GENERATE_BOP_GEMS (102),
|
|
||||||
AMPLITUDE (104),
|
|
||||||
BIOME_SIZE (105),
|
|
||||||
LAND_SCHEME (106),
|
|
||||||
RAIN_SCHEME (107),
|
|
||||||
GENERATE_POISON_IVY (117),
|
|
||||||
GENERATE_BERRY_BUSHES (119),
|
|
||||||
GENERATE_THORNS (120),
|
|
||||||
GENERATE_QUICKSAND (121),
|
|
||||||
GENERATE_LIQUID_POISON (122),
|
|
||||||
GENERATE_HOT_SPRINGS (123),
|
|
||||||
GENERATE_NETHER_HIVES (124),
|
|
||||||
GENERATE_END_FEATURES (126),
|
|
||||||
MAIN_NOISE_SCALE_X (127),
|
|
||||||
MAIN_NOISE_SCALE_Y (128),
|
|
||||||
MAIN_NOISE_SCALE_Z (129),
|
|
||||||
COORDINATE_SCALE (130),
|
|
||||||
HEIGHT_SCALE (131),
|
|
||||||
UPPER_LIMIT_SCALE (132),
|
|
||||||
LOWER_LIMIT_SCALE (133);
|
|
||||||
|
|
||||||
private int id;
|
|
||||||
|
|
||||||
GuiEntries(int id)
|
|
||||||
{
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
public int getId()
|
|
||||||
{
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static GuiEntries fromId(int id)
|
|
||||||
{
|
|
||||||
for (GuiEntries entry : GuiEntries.values())
|
|
||||||
{
|
|
||||||
if (entry.id == id)
|
|
||||||
{
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void setupPages()
|
|
||||||
{
|
|
||||||
this.pageNames = new String[3];
|
|
||||||
|
|
||||||
this.pageNames[0] = "World Settings";
|
|
||||||
GuiBOPPageList.GuiFieldEntry[] page0Fields = new GuiBOPPageList.GuiFieldEntry[] {
|
|
||||||
new GuiBOPPageList.GuiEnumButtonEntry<BiomeSize>(GuiEntries.BIOME_SIZE.getId(), "Biome Size: %s", true, this.settings.biomeSize),
|
|
||||||
new GuiBOPPageList.GuiEnumButtonEntry<LandMassScheme>(GuiEntries.LAND_SCHEME.getId(), "Land Mass: %s", true, this.settings.landScheme),
|
|
||||||
new GuiBOPPageList.GuiEnumButtonEntry<TemperatureVariationScheme>(GuiEntries.TEMP_SCHEME.getId(), "Temperature: %s", true, this.settings.tempScheme),
|
|
||||||
new GuiBOPPageList.GuiEnumButtonEntry<RainfallVariationScheme>(GuiEntries.RAIN_SCHEME.getId(), "Rainfall: %s", true, this.settings.rainScheme),
|
|
||||||
new GuiBOPPageList.GuiSlideEntry(GuiEntries.AMPLITUDE.getId(), "Amplitude", true, this, 0.2F, 3.0F, this.settings.amplitude),
|
|
||||||
new GuiBOPPageList.GuiSlideEntry(GuiEntries.MAIN_NOISE_SCALE_X.getId(), "Main Noise Scale X", true, this, 1.0F, 5000.0F, this.settings.mainNoiseScaleX),
|
|
||||||
new GuiBOPPageList.GuiSlideEntry(GuiEntries.MAIN_NOISE_SCALE_Y.getId(), "Main Noise Scale Y", true, this, 1.0F, 5000.0F, this.settings.mainNoiseScaleY),
|
|
||||||
new GuiBOPPageList.GuiSlideEntry(GuiEntries.MAIN_NOISE_SCALE_Z.getId(), "Main Noise Scale Z", true, this, 1.0F, 5000.0F, this.settings.mainNoiseScaleZ),
|
|
||||||
new GuiBOPPageList.GuiSlideEntry(GuiEntries.COORDINATE_SCALE.getId(), "Coordinate Scale", true, this, 1.0F, 6000.0F, this.settings.coordinateScale),
|
|
||||||
new GuiBOPPageList.GuiSlideEntry(GuiEntries.HEIGHT_SCALE.getId(), "Height Scale", true, this, 1.0F, 6000.0F, this.settings.heightScale),
|
|
||||||
new GuiBOPPageList.GuiSlideEntry(GuiEntries.UPPER_LIMIT_SCALE.getId(), "Upper Limit Scale", true, this, 1.0F, 5000.0F, this.settings.upperLimitScale),
|
|
||||||
new GuiBOPPageList.GuiSlideEntry(GuiEntries.LOWER_LIMIT_SCALE.getId(), "Lower Limit Scale", true, this, 1.0F, 5000.0F, this.settings.lowerLimitScale),
|
|
||||||
};
|
|
||||||
|
|
||||||
this.pageNames[1] = "Biome Settings";
|
|
||||||
GuiBOPPageList.GuiFieldEntry[] page1Fields = new GuiBOPPageList.GuiFieldEntry[] {
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
this.pageNames[2] = "Feature Generation Settings";
|
|
||||||
GuiBOPPageList.GuiFieldEntry[] page2Fields = new GuiBOPPageList.GuiFieldEntry[] {
|
|
||||||
new GuiBOPPageList.GuiButtonEntry(GuiEntries.GENERATE_BOP_GEMS.getId(), "BOP Gems", true, this.settings.generateBopGems),
|
|
||||||
new GuiBOPPageList.GuiButtonEntry(GuiEntries.GENERATE_POISON_IVY.getId(), "Poison Ivy", true, this.settings.generatePoisonIvy),
|
|
||||||
new GuiBOPPageList.GuiButtonEntry(GuiEntries.GENERATE_BERRY_BUSHES.getId(), "Berry Bushes", true, this.settings.generateBerryBushes),
|
|
||||||
new GuiBOPPageList.GuiButtonEntry(GuiEntries.GENERATE_THORNS.getId(), "Thorns", true, this.settings.generateThorns),
|
|
||||||
new GuiBOPPageList.GuiButtonEntry(GuiEntries.GENERATE_QUICKSAND.getId(), "Quicksand", true, this.settings.generateQuicksand),
|
|
||||||
new GuiBOPPageList.GuiButtonEntry(GuiEntries.GENERATE_LIQUID_POISON.getId(), "Liquid Poison Pools", true, this.settings.generateLiquidPoison),
|
|
||||||
new GuiBOPPageList.GuiButtonEntry(GuiEntries.GENERATE_HOT_SPRINGS.getId(), "Hot Spring Pools", true, this.settings.generateHotSprings),
|
|
||||||
new GuiBOPPageList.GuiButtonEntry(GuiEntries.GENERATE_NETHER_HIVES.getId(), "Nether Hives", true, this.settings.generateNetherHives),
|
|
||||||
new GuiBOPPageList.GuiButtonEntry(GuiEntries.GENERATE_END_FEATURES.getId(), "End Features", true, this.settings.generateEndFeatures)
|
|
||||||
};
|
|
||||||
|
|
||||||
this.pageManager = new GuiBOPPageManager(createTableForFields(page0Fields, page1Fields, page2Fields));
|
|
||||||
this.pageManager.setup();
|
|
||||||
|
|
||||||
this.showNewPage();
|
|
||||||
}
|
|
||||||
|
|
||||||
private GuiBOPPageTable[] createTableForFields(GuiBOPPageList.GuiFieldEntry[]... fieldGroup)
|
|
||||||
{
|
|
||||||
GuiBOPPageTable[] output = new GuiBOPPageTable[fieldGroup.length];
|
|
||||||
|
|
||||||
for (int i = 0; i < fieldGroup.length; i++)
|
|
||||||
{
|
|
||||||
GuiBOPPageList.GuiFieldEntry[] fields = fieldGroup[i];
|
|
||||||
output[i] = new GuiBOPPageTable(this.width, this.height, 32, this.height - 32, 25, i, this, fields);
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String serialize()
|
|
||||||
{
|
|
||||||
return this.settings.toString().replace("\n", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getText(int id, String name, float value)
|
|
||||||
{
|
|
||||||
return name + ": " + this.stringFormatFloat(id, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String stringFormatFloat(int fieldId, float value)
|
|
||||||
{
|
|
||||||
GuiEntries entry = GuiEntries.fromId(fieldId);
|
|
||||||
if (entry == null) {return "";}
|
|
||||||
|
|
||||||
switch (entry)
|
|
||||||
{
|
|
||||||
case AMPLITUDE:
|
|
||||||
case MAIN_NOISE_SCALE_X:
|
|
||||||
case MAIN_NOISE_SCALE_Y:
|
|
||||||
case MAIN_NOISE_SCALE_Z:
|
|
||||||
case COORDINATE_SCALE:
|
|
||||||
case HEIGHT_SCALE:
|
|
||||||
case UPPER_LIMIT_SCALE:
|
|
||||||
case LOWER_LIMIT_SCALE:
|
|
||||||
return String.format("%5.3f", Float.valueOf(value));
|
|
||||||
default:
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleEnumSelection(int fieldId, int ordinal)
|
|
||||||
{
|
|
||||||
GuiEntries entry = GuiEntries.fromId(fieldId);
|
|
||||||
if (entry == null) {return;}
|
|
||||||
|
|
||||||
switch (entry)
|
|
||||||
{
|
|
||||||
case LAND_SCHEME:
|
|
||||||
LandMassScheme[] land_values = LandMassScheme.values();
|
|
||||||
this.settings.landScheme = land_values[ordinal % land_values.length];
|
|
||||||
break;
|
|
||||||
case TEMP_SCHEME:
|
|
||||||
TemperatureVariationScheme[] temp_values = TemperatureVariationScheme.values();
|
|
||||||
this.settings.tempScheme = temp_values[ordinal % temp_values.length];
|
|
||||||
break;
|
|
||||||
case RAIN_SCHEME:
|
|
||||||
RainfallVariationScheme[] rain_values = RainfallVariationScheme.values();
|
|
||||||
this.settings.rainScheme = rain_values[ordinal % rain_values.length];
|
|
||||||
break;
|
|
||||||
case BIOME_SIZE:
|
|
||||||
BiomeSize[] size_values = BiomeSize.values();
|
|
||||||
this.settings.biomeSize = size_values[ordinal % size_values.length];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("settings currently: "+this.settings.toJson());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleBooleanSelection(int fieldId, boolean value)
|
|
||||||
{
|
|
||||||
GuiEntries entry = GuiEntries.fromId(fieldId);
|
|
||||||
if (entry == null) {return;}
|
|
||||||
|
|
||||||
switch (entry)
|
|
||||||
{
|
|
||||||
case GENERATE_BOP_GEMS:
|
|
||||||
this.settings.generateBopGems = value;
|
|
||||||
break;
|
|
||||||
case GENERATE_POISON_IVY:
|
|
||||||
this.settings.generatePoisonIvy = value;
|
|
||||||
break;
|
|
||||||
case GENERATE_BERRY_BUSHES:
|
|
||||||
this.settings.generateBerryBushes = value;
|
|
||||||
break;
|
|
||||||
case GENERATE_THORNS:
|
|
||||||
this.settings.generateThorns = value;
|
|
||||||
break;
|
|
||||||
case GENERATE_QUICKSAND:
|
|
||||||
this.settings.generateQuicksand = value;
|
|
||||||
break;
|
|
||||||
case GENERATE_LIQUID_POISON:
|
|
||||||
this.settings.generateLiquidPoison = value;
|
|
||||||
break;
|
|
||||||
case GENERATE_HOT_SPRINGS:
|
|
||||||
this.settings.generateHotSprings = value;
|
|
||||||
break;
|
|
||||||
case GENERATE_NETHER_HIVES:
|
|
||||||
this.settings.generateNetherHives = value;
|
|
||||||
break;
|
|
||||||
case GENERATE_END_FEATURES:
|
|
||||||
this.settings.generateEndFeatures = value;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("settings currently: "+this.settings.toJson());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleFloatSelection(int fieldId, float value)
|
|
||||||
{
|
|
||||||
GuiEntries entry = GuiEntries.fromId(fieldId);
|
|
||||||
if (entry == null) {return;}
|
|
||||||
|
|
||||||
switch (entry)
|
|
||||||
{
|
|
||||||
case AMPLITUDE:
|
|
||||||
this.settings.amplitude = value;
|
|
||||||
break;
|
|
||||||
case MAIN_NOISE_SCALE_X:
|
|
||||||
this.settings.mainNoiseScaleX = value;
|
|
||||||
break;
|
|
||||||
case MAIN_NOISE_SCALE_Y:
|
|
||||||
this.settings.mainNoiseScaleY = value;
|
|
||||||
break;
|
|
||||||
case MAIN_NOISE_SCALE_Z:
|
|
||||||
this.settings.mainNoiseScaleZ = value;
|
|
||||||
break;
|
|
||||||
case COORDINATE_SCALE:
|
|
||||||
this.settings.coordinateScale = value;
|
|
||||||
break;
|
|
||||||
case HEIGHT_SCALE:
|
|
||||||
this.settings.heightScale = value;
|
|
||||||
break;
|
|
||||||
case UPPER_LIMIT_SCALE:
|
|
||||||
this.settings.upperLimitScale = value;
|
|
||||||
break;
|
|
||||||
case LOWER_LIMIT_SCALE:
|
|
||||||
this.settings.lowerLimitScale = value;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("settings currently: "+this.settings.toJson());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleStringSelection(int fieldId, String value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleIntSelection(int fieldId, int value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// These 3 are the original functions required by GuiPageButtonList.GuiResponder - just pass off to the better named functions
|
|
||||||
@Override
|
|
||||||
public void setEntryValue(int fieldId, String value) {this.handleStringSelection(fieldId, value);}
|
|
||||||
@Override
|
|
||||||
public void setEntryValue(int fieldId, float value) {this.handleFloatSelection(fieldId, value);}
|
|
||||||
@Override
|
|
||||||
public void setEntryValue(int fieldId, boolean value) {this.handleBooleanSelection(fieldId, value);}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void actionPerformed(GuiButton button) throws IOException
|
|
||||||
{
|
|
||||||
if (button.enabled)
|
|
||||||
{
|
|
||||||
Actions action = Actions.fromId(button.id);
|
|
||||||
if (action == null) {return;}
|
|
||||||
switch (action)
|
|
||||||
{
|
|
||||||
case DONE:
|
|
||||||
this.parentScreen.chunkProviderSettingsJson = this.settings.toJson();
|
|
||||||
System.out.println("settings sent to world screen "+this.parentScreen.chunkProviderSettingsJson);
|
|
||||||
this.mc.displayGuiScreen(this.parentScreen);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PREVIOUS:
|
|
||||||
this.pageManager.gotToPrevPage(); // prev page
|
|
||||||
this.showNewPage();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NEXT:
|
|
||||||
this.pageManager.goToNextPage(); // next page
|
|
||||||
this.showNewPage();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DEFAULTS:
|
|
||||||
this.confirmSetDefaults(button.id);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case YES:
|
|
||||||
this.handleModalClose();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NO:
|
|
||||||
this.modalAction = 0;
|
|
||||||
this.handleModalClose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void doSetDefaults()
|
|
||||||
{
|
|
||||||
this.settings.setDefault();
|
|
||||||
this.setupPages();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void confirmSetDefaults(int actionId)
|
|
||||||
{
|
|
||||||
this.modalAction = actionId;
|
|
||||||
this.showModal(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void handleModalClose() throws IOException
|
|
||||||
{
|
|
||||||
Actions action = Actions.fromId(this.modalAction);
|
|
||||||
if (action != null) {
|
|
||||||
switch (action)
|
|
||||||
{
|
|
||||||
case DONE:
|
|
||||||
this.actionPerformed((GuiListButton)this.pageManager.getActivePage().getGui(300));
|
|
||||||
break;
|
|
||||||
case DEFAULTS:
|
|
||||||
this.doSetDefaults();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.modalAction = 0;
|
|
||||||
this.field_175340_C = true;
|
|
||||||
this.showModal(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showModal(boolean flag)
|
|
||||||
{
|
|
||||||
this.yesButton.visible = flag;
|
|
||||||
this.noButton.visible = flag;
|
|
||||||
this.doneButton.enabled = !flag;
|
|
||||||
this.prevButton.enabled = !flag;
|
|
||||||
this.nextButton.enabled = !flag;
|
|
||||||
this.defaultsButton.enabled = !flag;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showNewPage()
|
|
||||||
{
|
|
||||||
this.prevButton.enabled = this.pageManager.getActivePage().pageNumber != 0;
|
|
||||||
this.nextButton.enabled = this.pageManager.getActivePage().pageNumber != this.pageManager.getNumPages() - 1;
|
|
||||||
this.pageInfo = I18n.format("book.pageIndicator", Integer.valueOf(this.pageManager.getActivePage().pageNumber + 1), Integer.valueOf(this.pageManager.getNumPages()));
|
|
||||||
this.page0Title = this.pageNames[this.pageManager.getActivePage().pageNumber];
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void keyTyped(char typedChar, int keyCode) throws IOException
|
|
||||||
{
|
|
||||||
super.keyTyped(typedChar, keyCode);
|
|
||||||
|
|
||||||
if (this.modalAction == 0)
|
|
||||||
{
|
|
||||||
switch (keyCode)
|
|
||||||
{
|
|
||||||
case 200:
|
|
||||||
this.func_175327_a(1.0F);
|
|
||||||
break;
|
|
||||||
case 208:
|
|
||||||
this.func_175327_a(-1.0F);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this.pageManager.getActivePage().keyTyped(typedChar, keyCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void func_175327_a(float p_175327_1_)
|
|
||||||
{
|
|
||||||
Gui gui = this.pageManager.getActivePage().getFocusedGuiElement();
|
|
||||||
|
|
||||||
if (gui instanceof GuiTextField)
|
|
||||||
{
|
|
||||||
float f1 = p_175327_1_;
|
|
||||||
|
|
||||||
if (GuiScreen.isShiftKeyDown())
|
|
||||||
{
|
|
||||||
f1 = p_175327_1_ * 0.1F;
|
|
||||||
|
|
||||||
if (GuiScreen.isCtrlKeyDown())
|
|
||||||
{
|
|
||||||
f1 *= 0.1F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (GuiScreen.isCtrlKeyDown())
|
|
||||||
{
|
|
||||||
f1 = p_175327_1_ * 10.0F;
|
|
||||||
|
|
||||||
if (GuiScreen.isAltKeyDown())
|
|
||||||
{
|
|
||||||
f1 *= 10.0F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GuiTextField guitextfield = (GuiTextField)gui;
|
|
||||||
Float f2 = Floats.tryParse(guitextfield.getText());
|
|
||||||
|
|
||||||
if (f2 != null)
|
|
||||||
{
|
|
||||||
f2 = Float.valueOf(f2.floatValue() + f1);
|
|
||||||
int i = guitextfield.getId();
|
|
||||||
String s = this.stringFormatFloat(guitextfield.getId(), f2.floatValue());
|
|
||||||
guitextfield.setText(s);
|
|
||||||
this.setEntryValue(i, s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
|
||||||
{
|
|
||||||
this.drawDefaultBackground();
|
|
||||||
this.pageManager.getActivePage().drawScreen(mouseX, mouseY, partialTicks);
|
|
||||||
this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 2, 16777215);
|
|
||||||
this.drawCenteredString(this.fontRenderer, this.pageInfo, this.width / 2, 12, 16777215);
|
|
||||||
this.drawCenteredString(this.fontRenderer, this.page0Title, this.width / 2, 22, 16777215);
|
|
||||||
super.drawScreen(mouseX, mouseY, partialTicks);
|
|
||||||
|
|
||||||
if (this.modalAction != 0)
|
|
||||||
{
|
|
||||||
drawRect(0, 0, this.width, this.height, Integer.MIN_VALUE);
|
|
||||||
this.drawHorizontalLine(this.width / 2 - 91, this.width / 2 + 90, 99, -2039584);
|
|
||||||
this.drawHorizontalLine(this.width / 2 - 91, this.width / 2 + 90, 185, -6250336);
|
|
||||||
this.drawVerticalLine(this.width / 2 - 91, 99, 185, -2039584);
|
|
||||||
this.drawVerticalLine(this.width / 2 + 90, 99, 185, -6250336);
|
|
||||||
GlStateManager.disableLighting();
|
|
||||||
GlStateManager.disableFog();
|
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
|
||||||
BufferBuilder bufferBuilder = tessellator.getBuffer();
|
|
||||||
this.mc.getTextureManager().bindTexture(OPTIONS_BACKGROUND);
|
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
|
||||||
bufferBuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
|
|
||||||
bufferBuilder.pos((double)(this.width / 2 - 90), 185.0D, 0.0D).tex(0.0D, 2.65625D).color(64, 64, 64, 64).endVertex();
|
|
||||||
bufferBuilder.pos((double)(this.width / 2 + 90), 185.0D, 0.0D).tex(5.625D, 2.65625D).color(64, 64, 64, 64).endVertex();
|
|
||||||
bufferBuilder.pos((double)(this.width / 2 + 90), 100.0D, 0.0D).tex(5.625D, 0.0D).color(64, 64, 64, 64).endVertex();
|
|
||||||
bufferBuilder.pos((double)(this.width / 2 - 90), 100.0D, 0.0D).tex(0.0D, 0.0D).color(64, 64, 64, 64).endVertex();
|
|
||||||
tessellator.draw();
|
|
||||||
this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirmTitle"), this.width / 2, 105, 16777215);
|
|
||||||
this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm1"), this.width / 2, 125, 16777215);
|
|
||||||
this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm2"), this.width / 2, 135, 16777215);
|
|
||||||
this.yesButton.drawButton(this.mc, mouseX, mouseY, partialTicks);
|
|
||||||
this.noButton.drawButton(this.mc, mouseX, mouseY, partialTicks);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
package biomesoplenty.client.gui;
|
|
||||||
|
|
||||||
import biomesoplenty.common.config.GameplayConfigurationHandler;
|
|
||||||
import biomesoplenty.common.remote.TrailManager;
|
|
||||||
import biomesoplenty.common.util.entity.PlayerUtil;
|
|
||||||
import biomesoplenty.core.BiomesOPlenty;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
import net.minecraft.util.text.translation.I18n;
|
|
||||||
import net.minecraftforge.common.config.ConfigElement;
|
|
||||||
import net.minecraftforge.fml.client.DefaultGuiFactory;
|
|
||||||
import net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement;
|
|
||||||
import net.minecraftforge.fml.client.config.GuiConfig;
|
|
||||||
import net.minecraftforge.fml.client.config.IConfigElement;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static biomesoplenty.common.config.GameplayConfigurationHandler.CONVENIENCE_SETTINGS;
|
|
||||||
import static biomesoplenty.common.config.MiscConfigurationHandler.*;
|
|
||||||
|
|
||||||
public class GuiBOPFactory extends DefaultGuiFactory
|
|
||||||
{
|
|
||||||
public GuiBOPFactory()
|
|
||||||
{
|
|
||||||
super(BiomesOPlenty.MOD_ID, BiomesOPlenty.MOD_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GuiScreen createConfigGui(GuiScreen parentScreen)
|
|
||||||
{
|
|
||||||
return new GuiConfig(parentScreen, getConfigElements(), modid, false, false, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<IConfigElement> getConfigElements()
|
|
||||||
{
|
|
||||||
List<IConfigElement> list = new ArrayList<IConfigElement>();
|
|
||||||
|
|
||||||
List<IConfigElement> convenience_settings = new ConfigElement(GameplayConfigurationHandler.config.getCategory(CONVENIENCE_SETTINGS.toLowerCase())).getChildElements();
|
|
||||||
List<IConfigElement> gui_settings = new ConfigElement(config.getCategory(GUI_SETTINGS.toLowerCase())).getChildElements();
|
|
||||||
List<IConfigElement> texture_settings = new ConfigElement(config.getCategory(VISUAL_SETTINGS.toLowerCase())).getChildElements();
|
|
||||||
List<IConfigElement> trail_settings = new ConfigElement(config.getCategory(TRAIL_SETTINGS.toLowerCase())).getChildElements();
|
|
||||||
|
|
||||||
list.add(new DummyCategoryElement(I18n.translateToLocal("config.category.convenienceSettings.title"), "config.category.convenienceSettings", convenience_settings));
|
|
||||||
list.add(new DummyCategoryElement(I18n.translateToLocal("config.category.guiSettings.title"), "config.category.guiSettings", gui_settings));
|
|
||||||
list.add(new DummyCategoryElement(I18n.translateToLocal("config.category.textureSettings.title"), "config.category.textureSettings", texture_settings));
|
|
||||||
if (TrailManager.trailsMap.containsKey(PlayerUtil.getClientPlayerUUID()))
|
|
||||||
{
|
|
||||||
list.add(new DummyCategoryElement(I18n.translateToLocal("config.category.trailSettings.title"), "config.category.trailSettings", trail_settings));
|
|
||||||
}
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.client.gui;
|
|
||||||
|
|
||||||
public class GuiBOPPageBiomes //extends GuiBOPPageDelegate
|
|
||||||
{
|
|
||||||
//Subclass implementing GuiListExtended.IGuiListEntry
|
|
||||||
//Icon, label
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.client.gui;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
import net.minecraft.client.gui.GuiSlot;
|
|
||||||
|
|
||||||
public abstract class GuiBOPPageDelegate extends GuiSlot
|
|
||||||
{
|
|
||||||
public final int pageNumber;
|
|
||||||
|
|
||||||
public GuiBOPPageDelegate(int width, int height, int top, int bottom, int slotHeight, int pageNumber)
|
|
||||||
{
|
|
||||||
super(Minecraft.getMinecraft(), width, height, top, bottom, slotHeight);
|
|
||||||
|
|
||||||
this.pageNumber = pageNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void setup();
|
|
||||||
|
|
||||||
|
|
||||||
public abstract void setVisible(boolean isVisible);
|
|
||||||
|
|
||||||
public void mouseClicked(int mouseX, int mouseY, int mouseEvent) {}
|
|
||||||
public void mouseReleased(int mouseX, int mouseY, int state) {}
|
|
||||||
public void keyTyped(char typedChar, int keyCode) {}
|
|
||||||
public Gui getFocusedGuiElement() { return null; }
|
|
||||||
public Gui getGui(int fieldId) { return null; }
|
|
||||||
}
|
|
|
@ -1,383 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.client.gui;
|
|
||||||
|
|
||||||
import com.google.common.base.MoreObjects;
|
|
||||||
import com.google.common.base.Objects;
|
|
||||||
import com.google.common.base.Predicate;
|
|
||||||
import com.google.common.base.Predicates;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.client.gui.GuiLabel;
|
|
||||||
import net.minecraft.client.gui.GuiListExtended;
|
|
||||||
import net.minecraft.client.gui.GuiPageButtonList;
|
|
||||||
import net.minecraft.client.gui.GuiSlider;
|
|
||||||
import net.minecraft.client.gui.GuiTextField;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
public abstract class GuiBOPPageList extends GuiBOPPageDelegate
|
|
||||||
{
|
|
||||||
public GuiBOPPageList(int width, int height, int top, int bottom, int slotHeight, int pageNumber)
|
|
||||||
{
|
|
||||||
super(width, height, top, bottom, slotHeight, pageNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void elementClicked(int slotIndex, boolean isDoubleClick, int mouseX, int mouseY) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean isSelected(int slotIndex)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void drawBackground() {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void drawSlot(int entryID, int p_180791_2_, int p_180791_3_, int p_180791_4_, int mouseXIn, int mouseYIn, float partialTicks)
|
|
||||||
{
|
|
||||||
this.getListEntry(entryID).drawEntry(entryID, p_180791_2_, p_180791_3_, this.getListWidth(), p_180791_4_, mouseXIn, mouseYIn, this.getSlotIndexFromScreenCoords(mouseXIn, mouseYIn) == entryID, partialTicks);
|
|
||||||
}
|
|
||||||
|
|
||||||
// updateItemPos
|
|
||||||
@Override
|
|
||||||
protected void updateItemPos(int p_178040_1_, int p_178040_2_, int p_178040_3_, float partialTicks)
|
|
||||||
{
|
|
||||||
this.getListEntry(p_178040_1_).updatePosition(p_178040_1_, p_178040_2_, p_178040_3_, partialTicks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(int mouseX, int mouseY, int mouseEvent)
|
|
||||||
{
|
|
||||||
if (this.isMouseYWithinSlotBounds(mouseY))
|
|
||||||
{
|
|
||||||
int l = this.getSlotIndexFromScreenCoords(mouseX, mouseY);
|
|
||||||
|
|
||||||
if (l >= 0)
|
|
||||||
{
|
|
||||||
int i1 = this.left + this.width / 2 - this.getListWidth() / 2 + 2;
|
|
||||||
int j1 = this.top + 4 - this.getAmountScrolled() + l * this.slotHeight + this.headerPadding;
|
|
||||||
int k1 = mouseX - i1;
|
|
||||||
int l1 = mouseY - j1;
|
|
||||||
|
|
||||||
if (this.getListEntry(l).mousePressed(l, mouseX, mouseY, mouseEvent, k1, l1))
|
|
||||||
{
|
|
||||||
this.setEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseReleased(int mouseX, int mouseY, int state)
|
|
||||||
{
|
|
||||||
for (int l = 0; l < this.getSize(); ++l)
|
|
||||||
{
|
|
||||||
int i1 = this.left + this.width / 2 - this.getListWidth() / 2 + 2;
|
|
||||||
int j1 = this.top + 4 - this.getAmountScrolled() + l * this.slotHeight + this.headerPadding;
|
|
||||||
int k1 = mouseX - i1;
|
|
||||||
int l1 = mouseY - j1;
|
|
||||||
this.getListEntry(l).mouseReleased(l, mouseX, mouseY, state, k1, l1);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setEnabled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract GuiListExtended.IGuiListEntry getListEntry(int rowNum);
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public static class GuiSlideEntry extends GuiBOPPageList.GuiFieldEntry
|
|
||||||
{
|
|
||||||
private final GuiSlider.FormatHelper formatHelper;
|
|
||||||
private final float min;
|
|
||||||
private final float max;
|
|
||||||
private final float value;
|
|
||||||
|
|
||||||
public GuiSlideEntry(int fieldId, String labelText, boolean isVisible, GuiSlider.FormatHelper formatHelper, float min, float max, float value)
|
|
||||||
{
|
|
||||||
super(fieldId, labelText, isVisible);
|
|
||||||
this.formatHelper = formatHelper;
|
|
||||||
this.min = min;
|
|
||||||
this.max = max;
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GuiSlider.FormatHelper getFormatHelper()
|
|
||||||
{
|
|
||||||
return this.formatHelper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getMin()
|
|
||||||
{
|
|
||||||
return this.min;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getMax()
|
|
||||||
{
|
|
||||||
return this.max;
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getValue()
|
|
||||||
{
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public interface GuiResponder extends GuiPageButtonList.GuiResponder
|
|
||||||
{
|
|
||||||
void handleEnumSelection(int fieldId, int ordinal);
|
|
||||||
|
|
||||||
void handleBooleanSelection(int fieldId, boolean value);
|
|
||||||
|
|
||||||
void handleFloatSelection(int fieldId, float value);
|
|
||||||
|
|
||||||
void handleStringSelection(int fieldId, String value);
|
|
||||||
|
|
||||||
void handleIntSelection(int fieldId, int value);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public static class GuiFieldEntry
|
|
||||||
{
|
|
||||||
private final int fieldID;
|
|
||||||
private final String labelText;
|
|
||||||
private final boolean isVisible;
|
|
||||||
|
|
||||||
public GuiFieldEntry(int fieldId, String labelText, boolean isVisible)
|
|
||||||
{
|
|
||||||
this.fieldID = fieldId;
|
|
||||||
this.labelText = labelText;
|
|
||||||
this.isVisible = isVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFieldId()
|
|
||||||
{
|
|
||||||
return this.fieldID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLabelText()
|
|
||||||
{
|
|
||||||
return this.labelText;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isVisible()
|
|
||||||
{
|
|
||||||
return this.isVisible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public static class GuiLabelEntry extends GuiFieldEntry
|
|
||||||
{
|
|
||||||
public GuiLabelEntry(int fieldId, String labelText, boolean isVisible)
|
|
||||||
{
|
|
||||||
super(fieldId, labelText, isVisible);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public static class GuiRowEntry implements GuiListExtended.IGuiListEntry
|
|
||||||
{
|
|
||||||
private final Minecraft minecraft = Minecraft.getMinecraft();
|
|
||||||
private final Gui guiLeft;
|
|
||||||
private final Gui guiRight;
|
|
||||||
Gui focusedGui;
|
|
||||||
|
|
||||||
public GuiRowEntry(Gui guiLeft, Gui guiRight)
|
|
||||||
{
|
|
||||||
this.guiLeft = guiLeft;
|
|
||||||
this.guiRight = guiRight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Gui getGuiLeft()
|
|
||||||
{
|
|
||||||
return this.guiLeft;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Gui getGuiRight()
|
|
||||||
{
|
|
||||||
return this.guiRight;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isVisible, float partialTicks)
|
|
||||||
{
|
|
||||||
this.drawGui(this.guiLeft, y, mouseX, mouseY, false, partialTicks);
|
|
||||||
this.drawGui(this.guiRight, y, mouseX, mouseY, false, partialTicks);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawGui(Gui gui, int y, int mouseX, int mouseY, boolean isVisible, float partialTicks)
|
|
||||||
{
|
|
||||||
if (gui != null)
|
|
||||||
{
|
|
||||||
if (gui instanceof GuiButton)
|
|
||||||
{
|
|
||||||
this.drawGuiButton((GuiButton)gui, y, mouseX, mouseY, isVisible, partialTicks);
|
|
||||||
}
|
|
||||||
else if (gui instanceof GuiTextField)
|
|
||||||
{
|
|
||||||
this.drawGuiTextField((GuiTextField)gui, y, isVisible);
|
|
||||||
}
|
|
||||||
else if (gui instanceof GuiLabel)
|
|
||||||
{
|
|
||||||
this.drawGuiLabel((GuiLabel)gui, y, mouseX, mouseY, isVisible);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawGuiButton(GuiButton guiButton, int y, int mouseX, int mouseY, boolean isVisible, float partialTicks)
|
|
||||||
{
|
|
||||||
guiButton.y = y;
|
|
||||||
|
|
||||||
if (!isVisible)
|
|
||||||
{
|
|
||||||
guiButton.drawButton(this.minecraft, mouseX, mouseY, partialTicks);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawGuiTextField(GuiTextField guiTextField, int y, boolean isVisible)
|
|
||||||
{
|
|
||||||
guiTextField.y = y;
|
|
||||||
|
|
||||||
if (!isVisible)
|
|
||||||
{
|
|
||||||
guiTextField.drawTextBox();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void drawGuiLabel(GuiLabel guiLabel, int y, int mouseX, int mouseY, boolean isVisible)
|
|
||||||
{
|
|
||||||
guiLabel.y = y;
|
|
||||||
|
|
||||||
if (!isVisible)
|
|
||||||
{
|
|
||||||
guiLabel.drawLabel(this.minecraft, mouseX, mouseY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// setSelected
|
|
||||||
public void updatePosition(int p_178011_1_, int p_178011_2_, int p_178011_3_, float partialTicks)
|
|
||||||
{
|
|
||||||
this.drawGui(this.guiLeft, p_178011_3_, 0, 0, true, partialTicks);
|
|
||||||
this.drawGui(this.guiRight, p_178011_3_, 0, 0, true, partialTicks);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean mousePressed(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY)
|
|
||||||
{
|
|
||||||
return this.doMousePressed(this.guiLeft, x, y, mouseEvent) || this.doMousePressed(this.guiRight, x, y, mouseEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean doMousePressed(Gui gui, int x, int y, int mouseEvent)
|
|
||||||
{
|
|
||||||
if (gui == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (gui instanceof GuiButton)
|
|
||||||
{
|
|
||||||
if (((GuiButton)gui).mousePressed(this.minecraft, x, y))
|
|
||||||
{
|
|
||||||
this.focusedGui = gui;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (gui instanceof GuiTextField)
|
|
||||||
{
|
|
||||||
((GuiTextField)gui).mouseClicked(x, y, mouseEvent);
|
|
||||||
|
|
||||||
if (((GuiTextField)gui).isFocused())
|
|
||||||
{
|
|
||||||
this.focusedGui = gui;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY)
|
|
||||||
{
|
|
||||||
this.doMouseReleased(this.guiLeft, x, y);
|
|
||||||
this.doMouseReleased(this.guiRight, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doMouseReleased(Gui gui, int x, int y)
|
|
||||||
{
|
|
||||||
if (gui != null && (gui instanceof GuiButton))
|
|
||||||
{
|
|
||||||
((GuiButton)gui).mouseReleased(x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public static class GuiEnumButtonEntry<T extends Enum> extends GuiFieldEntry
|
|
||||||
{
|
|
||||||
private final T value;
|
|
||||||
|
|
||||||
public GuiEnumButtonEntry(int fieldId, String textLabel, boolean isVisible, T value)
|
|
||||||
{
|
|
||||||
super(fieldId, textLabel, isVisible);
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public T getValue()
|
|
||||||
{
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public static class GuiButtonEntry extends GuiFieldEntry
|
|
||||||
{
|
|
||||||
private final boolean value;
|
|
||||||
|
|
||||||
public GuiButtonEntry(int fieldId, String textLabel, boolean isVisible, boolean value)
|
|
||||||
{
|
|
||||||
super(fieldId, textLabel, isVisible);
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getValue()
|
|
||||||
{
|
|
||||||
return this.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public static class EditBoxEntry extends GuiFieldEntry
|
|
||||||
{
|
|
||||||
private final Predicate validator;
|
|
||||||
|
|
||||||
public EditBoxEntry(int fieldId, String labelText, boolean isVisible, Predicate validator)
|
|
||||||
{
|
|
||||||
super(fieldId, labelText, isVisible);
|
|
||||||
this.validator = MoreObjects.firstNonNull(validator, Predicates.alwaysTrue());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Predicate getValidator()
|
|
||||||
{
|
|
||||||
return this.validator;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,61 +0,0 @@
|
||||||
package biomesoplenty.client.gui;
|
|
||||||
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class GuiBOPPageManager
|
|
||||||
{
|
|
||||||
private GuiBOPPageDelegate[] pages;
|
|
||||||
private GuiBOPPageDelegate activePage;
|
|
||||||
|
|
||||||
public GuiBOPPageManager(GuiBOPPageDelegate ... pages)
|
|
||||||
{
|
|
||||||
this.pages = pages;
|
|
||||||
this.activePage = pages[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setup()
|
|
||||||
{
|
|
||||||
for (GuiBOPPageDelegate page : pages)
|
|
||||||
{
|
|
||||||
page.setup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public GuiBOPPageDelegate getActivePage()
|
|
||||||
{
|
|
||||||
return this.activePage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getNumPages()
|
|
||||||
{
|
|
||||||
return this.pages.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void gotToPrevPage()
|
|
||||||
{
|
|
||||||
if (this.activePage.pageNumber > 0)
|
|
||||||
{
|
|
||||||
int newPageNumber = this.activePage.pageNumber - 1;
|
|
||||||
GuiBOPPageDelegate newPage = this.pages[newPageNumber];
|
|
||||||
|
|
||||||
this.activePage.setVisible(false);
|
|
||||||
newPage.setVisible(true);
|
|
||||||
this.activePage = newPage;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void goToNextPage()
|
|
||||||
{
|
|
||||||
if (this.activePage.pageNumber < this.pages.length - 1)
|
|
||||||
{
|
|
||||||
int newPageNumber = this.activePage.pageNumber + 1;
|
|
||||||
GuiBOPPageDelegate newPage = this.pages[newPageNumber];
|
|
||||||
|
|
||||||
this.activePage.setVisible(false);
|
|
||||||
newPage.setVisible(true);
|
|
||||||
this.activePage = newPage;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,370 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.client.gui;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.lwjgl.input.Mouse;
|
|
||||||
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.client.gui.GuiLabel;
|
|
||||||
import net.minecraft.client.gui.GuiListButton;
|
|
||||||
import net.minecraft.client.gui.GuiListExtended;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
|
||||||
import net.minecraft.client.gui.GuiSlider;
|
|
||||||
import net.minecraft.client.gui.GuiTextField;
|
|
||||||
|
|
||||||
public class GuiBOPPageTable extends GuiBOPPageList
|
|
||||||
{
|
|
||||||
private final List<GuiBOPPageList.GuiRowEntry> allRows = new ArrayList<GuiBOPPageList.GuiRowEntry>();
|
|
||||||
private final Map<Integer, Gui> fieldIdToGuiMap = new HashMap<Integer, Gui>();
|
|
||||||
private final List<GuiTextField> allTextFieldGuis = new ArrayList<GuiTextField>();
|
|
||||||
private final GuiBOPPageList.GuiFieldEntry[] fields;
|
|
||||||
private GuiBOPPageList.GuiResponder responder;
|
|
||||||
private Gui focusedGui;
|
|
||||||
|
|
||||||
public GuiBOPPageTable(int width, int height, int top, int bottom, int slotHeight, int pageNumber, GuiBOPPageList.GuiResponder responder, GuiBOPPageList.GuiFieldEntry... fields)
|
|
||||||
{
|
|
||||||
super(width, height, top, bottom, slotHeight, pageNumber);
|
|
||||||
|
|
||||||
this.responder = responder;
|
|
||||||
this.fields = fields;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setVisible(boolean isVisible)
|
|
||||||
{
|
|
||||||
if (isVisible)
|
|
||||||
{
|
|
||||||
for (GuiBOPPageList.GuiFieldEntry field : this.fields)
|
|
||||||
{
|
|
||||||
if (field != null)
|
|
||||||
{
|
|
||||||
Gui gui = this.fieldIdToGuiMap.get(field.getFieldId());
|
|
||||||
this.setVisible(gui, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (GuiBOPPageList.GuiFieldEntry field : this.fields)
|
|
||||||
{
|
|
||||||
if (field != null)
|
|
||||||
{
|
|
||||||
Gui gui = this.fieldIdToGuiMap.get(field.getFieldId());
|
|
||||||
this.setVisible(gui, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setVisible(Gui gui, boolean isVisible)
|
|
||||||
{
|
|
||||||
if (gui instanceof GuiButton)
|
|
||||||
{
|
|
||||||
((GuiButton)gui).visible = isVisible;
|
|
||||||
}
|
|
||||||
else if (gui instanceof GuiTextField)
|
|
||||||
{
|
|
||||||
((GuiTextField)gui).setVisible(isVisible);
|
|
||||||
}
|
|
||||||
else if (gui instanceof GuiLabel)
|
|
||||||
{
|
|
||||||
((GuiLabel)gui).visible = isVisible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setup()
|
|
||||||
{
|
|
||||||
// go through the fields in twos (so they go in 2 columns)
|
|
||||||
for (int k = 0; k < fields.length; k += 2)
|
|
||||||
{
|
|
||||||
GuiBOPPageList.GuiFieldEntry fieldLeft = fields[k];
|
|
||||||
GuiBOPPageList.GuiFieldEntry fieldRight = k < fields.length - 1 ? fields[k + 1] : null;
|
|
||||||
|
|
||||||
Gui guiLeft = this.createGui(fieldLeft, 0, fieldRight == null);
|
|
||||||
Gui guiRight = this.createGui(fieldRight, 160, fieldLeft == null);
|
|
||||||
|
|
||||||
GuiBOPPageList.GuiRowEntry row = new GuiBOPPageList.GuiRowEntry(guiLeft, guiRight);
|
|
||||||
this.allRows.add(row);
|
|
||||||
|
|
||||||
if (fieldLeft != null && guiLeft != null)
|
|
||||||
{
|
|
||||||
this.fieldIdToGuiMap.put(fieldLeft.getFieldId(), guiLeft);
|
|
||||||
|
|
||||||
if (guiLeft instanceof GuiTextField)
|
|
||||||
{
|
|
||||||
this.allTextFieldGuis.add((GuiTextField)guiLeft);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fieldRight != null && guiRight != null)
|
|
||||||
{
|
|
||||||
this.fieldIdToGuiMap.put(fieldRight.getFieldId(), guiRight);
|
|
||||||
|
|
||||||
if (guiRight instanceof GuiTextField)
|
|
||||||
{
|
|
||||||
this.allTextFieldGuis.add((GuiTextField)guiRight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.resetRows();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resetRows()
|
|
||||||
{
|
|
||||||
this.allRows.clear();
|
|
||||||
|
|
||||||
for (int i = 0; i < this.fields.length; i += 2)
|
|
||||||
{
|
|
||||||
GuiBOPPageList.GuiFieldEntry guilistentryLeft = this.fields[i];
|
|
||||||
GuiBOPPageList.GuiFieldEntry guilistentryRight = i < this.fields.length - 1 ? this.fields[i + 1] : null;
|
|
||||||
Gui guiLeft = this.fieldIdToGuiMap.get(guilistentryLeft.getFieldId());
|
|
||||||
Gui guiRight = guilistentryRight != null ? this.fieldIdToGuiMap.get(guilistentryRight.getFieldId()) : null;
|
|
||||||
GuiBOPPageList.GuiRowEntry guientry = new GuiBOPPageList.GuiRowEntry(guiLeft, guiRight);
|
|
||||||
this.allRows.add(guientry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Gui getFocusedGuiElement()
|
|
||||||
{
|
|
||||||
return this.focusedGui;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Gui getGui(int fieldId)
|
|
||||||
{
|
|
||||||
return this.fieldIdToGuiMap.get(fieldId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private Gui createGui(GuiBOPPageList.GuiFieldEntry field, int xOffset, boolean hasNoNeighbor)
|
|
||||||
{
|
|
||||||
if (field instanceof GuiBOPPageList.GuiSlideEntry)
|
|
||||||
{
|
|
||||||
return this.createSlider(this.width / 2 - 155 + xOffset, 0, (GuiSlideEntry)field);
|
|
||||||
}
|
|
||||||
else if (field instanceof GuiBOPPageList.GuiButtonEntry)
|
|
||||||
{
|
|
||||||
return this.createListButton(this.width / 2 - 155 + xOffset, 0, (GuiButtonEntry)field);
|
|
||||||
}
|
|
||||||
else if (field instanceof GuiBOPPageList.EditBoxEntry)
|
|
||||||
{
|
|
||||||
return this.createTextField(this.width / 2 - 155 + xOffset, 0, (EditBoxEntry)field);
|
|
||||||
}
|
|
||||||
else if (field instanceof GuiBOPPageList.GuiLabelEntry)
|
|
||||||
{
|
|
||||||
return this.createLabel(this.width / 2 - 155 + xOffset, 0, (GuiLabelEntry)field, hasNoNeighbor);
|
|
||||||
}
|
|
||||||
else if (field instanceof GuiBOPPageList.GuiEnumButtonEntry)
|
|
||||||
{
|
|
||||||
return this.createEnumButton(this.width / 2 - 155 + xOffset, 0, (GuiEnumButtonEntry)field);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Mouse clicked
|
|
||||||
|
|
||||||
private GuiSlider createSlider(int xPosition, int yPosition, GuiBOPPageList.GuiSlideEntry field)
|
|
||||||
{
|
|
||||||
GuiSlider guislider = new GuiSlider(this.responder, field.getFieldId(), xPosition, yPosition, field.getLabelText(), field.getMin(), field.getMax(), field.getValue(), field.getFormatHelper());
|
|
||||||
guislider.visible = field.isVisible();
|
|
||||||
return guislider;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GuiListButton createListButton(int xPosition, int yPosition, GuiBOPPageList.GuiButtonEntry field)
|
|
||||||
{
|
|
||||||
GuiListButton guilistbutton = new GuiListButton(this.responder, field.getFieldId(), xPosition, yPosition, field.getLabelText(), field.getValue());
|
|
||||||
guilistbutton.visible = field.isVisible();
|
|
||||||
return guilistbutton;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GuiEnumButton createEnumButton(int xPosition, int yPosition, GuiBOPPageList.GuiEnumButtonEntry field)
|
|
||||||
{
|
|
||||||
GuiEnumButton guienumbutton = new GuiEnumButton(this.responder, field.getFieldId(), xPosition, yPosition, field.getLabelText(), field.getValue());
|
|
||||||
guienumbutton.visible = field.isVisible();
|
|
||||||
return guienumbutton;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GuiTextField createTextField(int xPosition, int yPosition, GuiBOPPageList.EditBoxEntry field)
|
|
||||||
{
|
|
||||||
GuiTextField guitextfield = new GuiTextField(field.getFieldId(), this.mc.fontRenderer, xPosition, yPosition, 150, 20);
|
|
||||||
guitextfield.setText(field.getLabelText());
|
|
||||||
guitextfield.setGuiResponder(this.responder);
|
|
||||||
guitextfield.setVisible(field.isVisible());
|
|
||||||
guitextfield.setValidator(field.getValidator());
|
|
||||||
return guitextfield;
|
|
||||||
}
|
|
||||||
|
|
||||||
private GuiLabel createLabel(int xPosition, int yPosition, GuiBOPPageList.GuiLabelEntry field, boolean hasNoNeighbor)
|
|
||||||
{
|
|
||||||
GuiLabel guilabel;
|
|
||||||
|
|
||||||
if (hasNoNeighbor)
|
|
||||||
{
|
|
||||||
guilabel = new GuiLabel(this.mc.fontRenderer, field.getFieldId(), xPosition, yPosition, this.width - xPosition * 2, 20, -1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
guilabel = new GuiLabel(this.mc.fontRenderer, field.getFieldId(), xPosition, yPosition, 150, 20, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
guilabel.visible = field.isVisible();
|
|
||||||
guilabel.addLine(field.getLabelText());
|
|
||||||
guilabel.setCentered();
|
|
||||||
return guilabel;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void keyTyped(char typedChar, int keyCode)
|
|
||||||
{
|
|
||||||
if (this.focusedGui instanceof GuiTextField)
|
|
||||||
{
|
|
||||||
GuiTextField guitextfield = (GuiTextField)this.focusedGui;
|
|
||||||
int j;
|
|
||||||
|
|
||||||
//Check if aren't we are pasting text
|
|
||||||
if (!GuiScreen.isKeyComboCtrlV(keyCode))
|
|
||||||
{
|
|
||||||
if (keyCode == 15) //Tab is pressed
|
|
||||||
{
|
|
||||||
guitextfield.setFocused(false);
|
|
||||||
int focusedGuiIndex = this.allTextFieldGuis.indexOf(this.focusedGui);
|
|
||||||
|
|
||||||
if (GuiScreen.isShiftKeyDown())
|
|
||||||
{
|
|
||||||
if (focusedGuiIndex == 0) //Jump back to the end of the list when at the start
|
|
||||||
{
|
|
||||||
focusedGuiIndex = this.allTextFieldGuis.size() - 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
--focusedGuiIndex; //Cycle backwards through the text fields
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (focusedGuiIndex == this.allTextFieldGuis.size() - 1) //Jump back to the start of the list when at the end
|
|
||||||
{
|
|
||||||
focusedGuiIndex = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++focusedGuiIndex; //Cycle forwards through the text fields
|
|
||||||
}
|
|
||||||
|
|
||||||
this.focusedGui = this.allTextFieldGuis.get(focusedGuiIndex);
|
|
||||||
guitextfield = (GuiTextField)this.focusedGui;
|
|
||||||
guitextfield.setFocused(true);
|
|
||||||
int k1 = guitextfield.y + this.slotHeight;
|
|
||||||
j = guitextfield.y;
|
|
||||||
|
|
||||||
if (k1 > this.bottom)
|
|
||||||
{
|
|
||||||
this.amountScrolled += (float)(k1 - this.bottom);
|
|
||||||
}
|
|
||||||
else if (j < this.top)
|
|
||||||
{
|
|
||||||
this.amountScrolled = (float)j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
guitextfield.textboxKeyTyped(typedChar, keyCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
String s = GuiScreen.getClipboardString();
|
|
||||||
String[] astring = s.split(";");
|
|
||||||
j = this.allTextFieldGuis.indexOf(this.focusedGui);
|
|
||||||
int k = j;
|
|
||||||
String[] astring1 = astring;
|
|
||||||
int l = astring.length;
|
|
||||||
|
|
||||||
for (int i1 = 0; i1 < l; ++i1)
|
|
||||||
{
|
|
||||||
String s1 = astring1[i1];
|
|
||||||
this.allTextFieldGuis.get(k).setText(s1);
|
|
||||||
|
|
||||||
if (k == this.allTextFieldGuis.size() - 1)
|
|
||||||
{
|
|
||||||
k = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++k;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (k == j)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public GuiBOPPageList.GuiRowEntry getRow(int rowNum)
|
|
||||||
{
|
|
||||||
return this.allRows.get(rowNum);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getSize()
|
|
||||||
{
|
|
||||||
return this.allRows.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getListWidth()
|
|
||||||
{
|
|
||||||
return 400;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getScrollBarX()
|
|
||||||
{
|
|
||||||
return super.getScrollBarX() + 32;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GuiListExtended.IGuiListEntry getListEntry(int rowNum)
|
|
||||||
{
|
|
||||||
return this.getRow(rowNum);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void mouseClicked(int mouseX, int mouseY, int mouseButton)
|
|
||||||
{
|
|
||||||
super.mouseClicked(mouseX, mouseY, Mouse.getEventButton());
|
|
||||||
int l = this.getSlotIndexFromScreenCoords(mouseX, mouseY);
|
|
||||||
|
|
||||||
if (l >= 0)
|
|
||||||
{
|
|
||||||
GuiBOPPageTable.GuiRowEntry row = this.getRow(l);
|
|
||||||
|
|
||||||
if (this.focusedGui != row.focusedGui && this.focusedGui != null && this.focusedGui instanceof GuiTextField)
|
|
||||||
{
|
|
||||||
((GuiTextField)this.focusedGui).setFocused(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.focusedGui = row.focusedGui;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
package biomesoplenty.client.gui;
|
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.client.resources.I18n;
|
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public class GuiEnumButton<T extends Enum> extends GuiButton
|
|
||||||
{
|
|
||||||
private T value;
|
|
||||||
private String localizationStr;
|
|
||||||
private final GuiBOPPageList.GuiResponder guiResponder;
|
|
||||||
|
|
||||||
public GuiEnumButton(GuiBOPPageList.GuiResponder responder, int fieldId, int x, int y, String localizationStr, T initialValue)
|
|
||||||
{
|
|
||||||
super(fieldId, x, y, 150, 20, "");
|
|
||||||
this.localizationStr = localizationStr;
|
|
||||||
this.value = initialValue;
|
|
||||||
this.displayString = this.buildDisplayString();
|
|
||||||
this.guiResponder = responder;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String buildDisplayString()
|
|
||||||
{
|
|
||||||
return I18n.format(this.localizationStr, this.value.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(T value)
|
|
||||||
{
|
|
||||||
this.value = value;
|
|
||||||
this.displayString = this.buildDisplayString();
|
|
||||||
this.guiResponder.handleEnumSelection(this.id, value.ordinal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean mousePressed(Minecraft mc, int mouseX, int mouseY)
|
|
||||||
{
|
|
||||||
if (super.mousePressed(mc, mouseX, mouseY))
|
|
||||||
{
|
|
||||||
Object[] values = this.value.getClass().getEnumConstants();
|
|
||||||
int len = values.length;
|
|
||||||
this.value = (T)(values[(this.value.ordinal() + 1) % len]);
|
|
||||||
this.displayString = this.buildDisplayString();
|
|
||||||
this.guiResponder.handleEnumSelection(this.id, this.value.ordinal());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,130 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.client.particle;
|
|
||||||
|
|
||||||
import biomesoplenty.core.ClientProxy;
|
|
||||||
import net.minecraft.client.particle.Particle;
|
|
||||||
import net.minecraft.client.renderer.BufferBuilder;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.util.math.MathHelper;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
|
||||||
|
|
||||||
public class EntityCurseFX extends Particle
|
|
||||||
{
|
|
||||||
private float defaultParticleScale;
|
|
||||||
|
|
||||||
public EntityCurseFX(World world, double xCoordIn, double yCoordIn, double zCoordIn, double motionXIn, double motionYIn, double motionZIn)
|
|
||||||
{
|
|
||||||
this(world, xCoordIn, yCoordIn, zCoordIn, motionXIn, motionYIn, motionZIn, 1.0F);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityCurseFX(World world, double xCoordIn, double yCoordIn, double zCoordIn, double motionXIn, double motionYIn, double motionZIn, float par14)
|
|
||||||
{
|
|
||||||
super(world, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
|
|
||||||
|
|
||||||
this.particleTextureIndexX = 7;
|
|
||||||
this.particleTextureIndexY = 5;
|
|
||||||
|
|
||||||
this.motionX *= 0.10000000149011612D;
|
|
||||||
this.motionY *= 0.10000000149011612D;
|
|
||||||
this.motionZ *= 0.10000000149011612D;
|
|
||||||
this.motionX += motionXIn;
|
|
||||||
this.motionY += motionYIn;
|
|
||||||
this.motionZ += motionZIn;
|
|
||||||
this.particleScale = 1.0F;
|
|
||||||
this.defaultParticleScale = this.particleScale;
|
|
||||||
this.particleMaxAge = (int)((8.0D / (Math.random() * 0.8D + 0.2D)) * 8);
|
|
||||||
this.particleMaxAge = (int)((float)this.particleMaxAge * par14);
|
|
||||||
this.particleAge = world.rand.nextInt(3);
|
|
||||||
this.particleAlpha = 1.0F;
|
|
||||||
this.particleGravity = 0.02F;
|
|
||||||
this.canCollide = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFXLayer()
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderParticle(BufferBuilder buffer, Entity entity, float partialTicks, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY)
|
|
||||||
{
|
|
||||||
// EffectRenderer will by default bind the vanilla particles texture, override with our own
|
|
||||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particleTexturesLocation);
|
|
||||||
|
|
||||||
float scaleMultiplier = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F;
|
|
||||||
scaleMultiplier = MathHelper.clamp(scaleMultiplier, 0.0F, 1.0F);
|
|
||||||
this.particleScale = this.defaultParticleScale * scaleMultiplier;
|
|
||||||
|
|
||||||
GlStateManager.depthMask(false);
|
|
||||||
GlStateManager.enableBlend();
|
|
||||||
GlStateManager.blendFunc(770, 1);
|
|
||||||
|
|
||||||
super.renderParticle(buffer, entity, partialTicks, rotX, rotXZ, rotZ, rotYZ, rotXY);
|
|
||||||
|
|
||||||
GlStateManager.disableBlend();
|
|
||||||
GlStateManager.depthMask(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getBrightnessForRender(float p_189214_1_)
|
|
||||||
{
|
|
||||||
float f = (float)this.particleMaxAge - (((float)this.particleAge + p_189214_1_) / (float)this.particleMaxAge);
|
|
||||||
f = MathHelper.clamp(f, 0.0F, 1.0F);
|
|
||||||
int i = super.getBrightnessForRender(p_189214_1_);
|
|
||||||
int j = i & 255;
|
|
||||||
int k = i >> 16 & 255;
|
|
||||||
j = j + (int)(f * 15.0F * 16.0F);
|
|
||||||
|
|
||||||
if (j > 240)
|
|
||||||
{
|
|
||||||
j = 240;
|
|
||||||
}
|
|
||||||
|
|
||||||
return j | k << 16;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUpdate()
|
|
||||||
{
|
|
||||||
prevPosX = posX;
|
|
||||||
prevPosY = posY;
|
|
||||||
prevPosZ = posZ;
|
|
||||||
|
|
||||||
particleAge += 2;
|
|
||||||
|
|
||||||
if (particleAge >= particleMaxAge)
|
|
||||||
{
|
|
||||||
this.setExpired();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.particleTextureIndexX = 7 - this.particleAge * 8 / this.particleMaxAge;
|
|
||||||
this.move(motionX, motionY, motionZ);
|
|
||||||
|
|
||||||
if (posY == prevPosY)
|
|
||||||
{
|
|
||||||
motionX *= 1.1D;
|
|
||||||
motionZ *= 1.1D;
|
|
||||||
}
|
|
||||||
|
|
||||||
motionX *= 0.9599999785423279D;
|
|
||||||
motionY *= 0.9599999785423279D;
|
|
||||||
motionZ *= 0.9599999785423279D;
|
|
||||||
|
|
||||||
if (onGround)
|
|
||||||
{
|
|
||||||
motionX *= 0.699999988079071D;
|
|
||||||
motionZ *= 0.699999988079071D;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,80 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.client.particle;
|
|
||||||
|
|
||||||
import net.minecraft.client.particle.Particle;
|
|
||||||
import net.minecraft.client.renderer.BufferBuilder;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
|
||||||
|
|
||||||
public class EntityTrailFX extends Particle
|
|
||||||
{
|
|
||||||
private ResourceLocation trailResource;
|
|
||||||
/**The index of the flower to be spawned, values are 0-3*/
|
|
||||||
private int particleIndex;
|
|
||||||
private double startY;
|
|
||||||
|
|
||||||
public EntityTrailFX(World world, double x, double y, double z, String trailName)
|
|
||||||
{
|
|
||||||
super(world, x, y, z);
|
|
||||||
|
|
||||||
this.trailResource = new ResourceLocation("biomesoplenty:textures/particles/" + trailName + ".png");
|
|
||||||
this.motionX = this.motionY = this.motionZ = 0.0D; //Trail particles should not move
|
|
||||||
this.particleMaxAge = 550;
|
|
||||||
this.particleIndex = this.rand.nextInt(4); //Choose a random index on creation
|
|
||||||
this.startY = y; //Where y coordinate where this particle has started (before it moves downwards with time)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderParticle(BufferBuilder builder, Entity entity, float partialTicks, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY)
|
|
||||||
{
|
|
||||||
// EffectRenderer will by default bind the vanilla particles texture, override with our own
|
|
||||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.trailResource);
|
|
||||||
|
|
||||||
//The overall maxU and maxV of the particle sheet is 1.0 (representing 16px)
|
|
||||||
float minU = (particleIndex % 2) * 0.5F; //Particles on the left side are 0, right are 0.5
|
|
||||||
float maxU = minU + 0.5F; //Each flower is 8px wide (half of the overall sheet)
|
|
||||||
|
|
||||||
float minV = (particleIndex / 2) * 0.5F; //Uses integer rounding errors (0 and 1 = 0, 2 and 3 = 1)
|
|
||||||
float maxV = minV + 0.5F; //Each flower is 8px high (half of the overall sheet)
|
|
||||||
|
|
||||||
//Vanilla particle rendering
|
|
||||||
float alpha = 1.0F - Math.min(1.0F, 2.0F * this.particleAge / this.particleMaxAge);
|
|
||||||
float width = 0.15F;
|
|
||||||
float x = (float)(prevPosX + (posX - prevPosX) - interpPosX);
|
|
||||||
float y = (float)(prevPosY + (posY - prevPosY) - interpPosY);
|
|
||||||
float z = (float)(prevPosZ + (posZ - prevPosZ) - interpPosZ);
|
|
||||||
|
|
||||||
int i = this.getBrightnessForRender(partialTicks);
|
|
||||||
int j = i >> 16 & 65535;
|
|
||||||
int k = i & 65535;
|
|
||||||
|
|
||||||
builder.pos(x - width, y, z + width).tex(minU, maxV).color(this.particleRed, this.particleGreen, this.particleBlue, alpha).lightmap(j, k).endVertex();
|
|
||||||
builder.pos(x + width, y, z + width).tex(minU, minV).color(this.particleRed, this.particleGreen, this.particleBlue, alpha).lightmap(j, k).endVertex();
|
|
||||||
builder.pos(x + width, y, z - width).tex(maxU, minV).color(this.particleRed, this.particleGreen, this.particleBlue, alpha).lightmap(j, k).endVertex();
|
|
||||||
builder.pos(x - width, y, z - width).tex(maxU, maxV).color(this.particleRed, this.particleGreen, this.particleBlue, alpha).lightmap(j, k).endVertex();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFXLayer()
|
|
||||||
{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUpdate()
|
|
||||||
{
|
|
||||||
super.onUpdate();
|
|
||||||
|
|
||||||
this.posY = this.startY - 0.01 * ((float)this.particleAge / (float)this.particleMaxAge);
|
|
||||||
this.prevPosY = this.posY;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.client.util;
|
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
|
||||||
|
|
||||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
|
||||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraftforge.client.model.IModel;
|
|
||||||
|
|
||||||
public class ModelUtils
|
|
||||||
{
|
|
||||||
public static IBakedModel[] generateModelsForTextures(IModel model, TextureAtlasSprite[] textures)
|
|
||||||
{
|
|
||||||
IBakedModel[] output = new IBakedModel[textures.length];
|
|
||||||
|
|
||||||
for (int i = 0; i < output.length; i++)
|
|
||||||
{
|
|
||||||
final TextureAtlasSprite texture = textures[i];
|
|
||||||
|
|
||||||
//Defines how TextureAtlasSprites are obtained whilst baking
|
|
||||||
Function<ResourceLocation, TextureAtlasSprite> textureGetter = new Function<ResourceLocation, TextureAtlasSprite>()
|
|
||||||
{
|
|
||||||
public TextureAtlasSprite apply(ResourceLocation location)
|
|
||||||
{
|
|
||||||
return texture;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
output[i] = model.bake(model.getDefaultState(), DefaultVertexFormats.ITEM, textureGetter);
|
|
||||||
}
|
|
||||||
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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.client.util;
|
|
||||||
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
|
|
||||||
public class TextureUtils
|
|
||||||
{
|
|
||||||
public static final String TEXTURES_BASE_PATH = "textures";
|
|
||||||
|
|
||||||
public static ResourceLocation completeResourceLocation(ResourceLocation location, int mode)
|
|
||||||
{
|
|
||||||
return mode == 0 ? new ResourceLocation(location.getResourceDomain(), String.format("%s/%s%s", TEXTURES_BASE_PATH, location.getResourcePath(), ".png")) : new ResourceLocation(location.getResourceDomain(), String.format("%s/mipmaps/%s.%d%s", TEXTURES_BASE_PATH, location.getResourcePath(), Integer.valueOf(mode), ".png"));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,328 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2017, 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;
|
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BiomeOwner;
|
|
||||||
import biomesoplenty.api.biome.IExtendedBiome;
|
|
||||||
import biomesoplenty.api.config.IBOPWorldSettings;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.api.generation.IGenerator;
|
|
||||||
import biomesoplenty.common.init.ModBiomes;
|
|
||||||
import biomesoplenty.common.world.GenerationManager;
|
|
||||||
import biomesoplenty.core.BiomesOPlenty;
|
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityLiving;
|
|
||||||
import net.minecraft.entity.EnumCreatureType;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
public abstract class BOPBiome extends Biome implements IExtendedBiome
|
|
||||||
{
|
|
||||||
protected GenerationManager generationManager = new GenerationManager();
|
|
||||||
protected Map<BOPClimates, Integer> weightMap = new HashMap<BOPClimates, Integer>();
|
|
||||||
|
|
||||||
// defaults
|
|
||||||
|
|
||||||
// -1 indicates the defaults as set by Vanilla will be used for the below fields
|
|
||||||
public int skyColor = -1;
|
|
||||||
public int fogColor = -1;
|
|
||||||
|
|
||||||
/** 1.0 is the lowest possible amount of fog. 0.0 is the greatest.*/
|
|
||||||
public float fogDensity = 1.0F;
|
|
||||||
|
|
||||||
public boolean hasBiomeEssence = true;
|
|
||||||
|
|
||||||
public final ResourceLocation location;
|
|
||||||
public IConfigObj conf;
|
|
||||||
|
|
||||||
private BOPBiome(ResourceLocation idLoc, PropsBuilder defaultBuilder, IConfigObj conf)
|
|
||||||
{
|
|
||||||
super(configureBiomeProps(idLoc, defaultBuilder, conf));
|
|
||||||
|
|
||||||
this.location = idLoc;
|
|
||||||
this.conf = conf;
|
|
||||||
|
|
||||||
this.decorator.treesPerChunk = -999;
|
|
||||||
this.decorator.flowersPerChunk = -999;
|
|
||||||
this.decorator.grassPerChunk = -999;
|
|
||||||
this.decorator.gravelPatchesPerChunk = -999;
|
|
||||||
this.decorator.sandPatchesPerChunk = -999;
|
|
||||||
//this.theBiomeDecorator.generateLakes = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected BOPBiome(String idName, PropsBuilder defaultBuilder)
|
|
||||||
{
|
|
||||||
this(new ResourceLocation(BiomesOPlenty.MOD_ID, idName), defaultBuilder, ModBiomes.readConfigFile(idName));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static BOPBiome.BiomeProps configureBiomeProps(ResourceLocation idLoc, BOPBiome.PropsBuilder defaultBuilder, IConfigObj conf)
|
|
||||||
{
|
|
||||||
// If there isn't a valid config file, don't use it to configure the biome
|
|
||||||
if (conf.isEmpty())
|
|
||||||
return defaultBuilder.build();
|
|
||||||
|
|
||||||
defaultBuilder.withTemperature(conf.getFloat("temperature", defaultBuilder.temperature));
|
|
||||||
defaultBuilder.withRainfall(conf.getFloat("rainfall", defaultBuilder.rainfall));
|
|
||||||
defaultBuilder.withWaterColor(conf.getInt("waterColor", defaultBuilder.waterColor));
|
|
||||||
|
|
||||||
Boolean enableRain = conf.getBool("enableRain", defaultBuilder.enableRain);
|
|
||||||
if (enableRain != null && !enableRain) defaultBuilder.withRainDisabled();
|
|
||||||
|
|
||||||
Boolean enableSnow = conf.getBool("enableSnow", defaultBuilder.enableSnow);
|
|
||||||
if (enableSnow != null && enableSnow) defaultBuilder.withSnowEnabled();
|
|
||||||
|
|
||||||
defaultBuilder.withBaseBiome(conf.getString("baseBiome", defaultBuilder.baseBiomeRegName));
|
|
||||||
defaultBuilder.withGuiColour(conf.getInt("guiColour", defaultBuilder.guiColour));
|
|
||||||
|
|
||||||
return defaultBuilder.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void applySettings(IBOPWorldSettings settings) {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
this.topBlock = conf.getBlockState("topBlock", this.topBlock);
|
|
||||||
this.fillerBlock = conf.getBlockState("fillerBlock", this.fillerBlock);
|
|
||||||
|
|
||||||
this.skyColor = conf.getInt("skyColor", this.skyColor);
|
|
||||||
this.fogColor = conf.getInt("fogColor", this.fogColor);
|
|
||||||
this.fogDensity = conf.getFloat("fogDensity", this.fogDensity);
|
|
||||||
this.hasBiomeEssence = conf.getBool("hasBiomeEssence", this.hasBiomeEssence);
|
|
||||||
|
|
||||||
// Allow weights to be overridden
|
|
||||||
IConfigObj confWeights = conf.getObject("weights");
|
|
||||||
for (BOPClimates climate : BOPClimates.values())
|
|
||||||
{
|
|
||||||
Integer weight = confWeights.getInt(climate.name().toLowerCase(), this.weightMap.get(climate));
|
|
||||||
if (weight == null) {continue;}
|
|
||||||
if (weight.intValue() < 1)
|
|
||||||
{
|
|
||||||
this.weightMap.remove(climate);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.weightMap.put(climate, weight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allow generators to be configured
|
|
||||||
IConfigObj confGenerators = conf.getObject("generators");
|
|
||||||
this.generationManager.configure(confGenerators);
|
|
||||||
|
|
||||||
// Allow spawnable entites to be configured
|
|
||||||
ArrayList<IConfigObj> confEntities = conf.getObjectArray("entities");
|
|
||||||
if (confEntities != null)
|
|
||||||
{
|
|
||||||
for (IConfigObj confEntity : confEntities)
|
|
||||||
{
|
|
||||||
String entityName = confEntity.getString("name");
|
|
||||||
EnumCreatureType creatureType = confEntity.getEnum("creatureType", EnumCreatureType.class);
|
|
||||||
if (entityName == null || creatureType == null) {continue;}
|
|
||||||
|
|
||||||
// Look for an entity class matching this name
|
|
||||||
// case insensitive, dot used as mod delimiter, no spaces or underscores
|
|
||||||
// eg 'villager', 'Zombie', 'SQUID', 'enderdragon', 'biomesoplenty.wasp' all ok
|
|
||||||
Class <? extends Entity> entityClazz = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(entityName)).getEntityClass();
|
|
||||||
Class <? extends EntityLiving> livingClazz = null;
|
|
||||||
if (!(entityClazz.isAssignableFrom(EntityLiving.class))) {
|
|
||||||
confEntity.addMessage("Entity " + entityName + " is not of type EntityLiving");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
livingClazz = (Class <? extends EntityLiving>)entityClazz;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (livingClazz == null)
|
|
||||||
{
|
|
||||||
confEntity.addMessage("No entity registered called " + entityName);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!creatureType.getCreatureClass().isAssignableFrom(livingClazz))
|
|
||||||
{
|
|
||||||
confEntity.addMessage("Entity " + entityName + " is not of type " + creatureType);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<SpawnListEntry> spawns = this.getSpawnableList(creatureType);
|
|
||||||
Integer weight = confEntity.getInt("weight");
|
|
||||||
if (weight != null && weight < 1)
|
|
||||||
{
|
|
||||||
// weight was set to zero (or negative) so find and remove this spawn
|
|
||||||
Iterator<SpawnListEntry> spawnIterator = spawns.iterator();
|
|
||||||
while (spawnIterator.hasNext())
|
|
||||||
{
|
|
||||||
SpawnListEntry entry = spawnIterator.next();
|
|
||||||
if (entry.entityClass == livingClazz)
|
|
||||||
{
|
|
||||||
spawnIterator.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// weight was positive, or omitted, so update an existing spawn or add a new spawn
|
|
||||||
boolean foundIt = false;
|
|
||||||
for (SpawnListEntry entry : spawns)
|
|
||||||
{
|
|
||||||
if (entry.entityClass == entityClazz)
|
|
||||||
{
|
|
||||||
// the entry already exists - adjust the params
|
|
||||||
entry.itemWeight = confEntity.getInt("weight", entry.itemWeight);
|
|
||||||
entry.minGroupCount = confEntity.getInt("minGroupCount", entry.minGroupCount);
|
|
||||||
entry.maxGroupCount = confEntity.getInt("maxGroupCount", entry.maxGroupCount);
|
|
||||||
foundIt = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!foundIt)
|
|
||||||
{
|
|
||||||
// the entry does not exist - add it
|
|
||||||
SpawnListEntry entry = new SpawnListEntry(livingClazz, confEntity.getInt("weight", 10), confEntity.getInt("minGroupCount", 4), confEntity.getInt("maxGroupCount", 4));
|
|
||||||
spawns.add(entry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BiomeOwner getBiomeOwner()
|
|
||||||
{
|
|
||||||
return BiomeOwner.BIOMESOPLENTY;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addGenerator(String name, GeneratorStage stage, IGenerator generator)
|
|
||||||
{
|
|
||||||
this.generationManager.addGenerator(name, stage, generator);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IGenerator getGenerator(String name)
|
|
||||||
{
|
|
||||||
return this.generationManager.getGenerator(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeGenerator(String name)
|
|
||||||
{
|
|
||||||
this.generationManager.removeGenerator(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GenerationManager getGenerationManager()
|
|
||||||
{
|
|
||||||
return this.generationManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<BOPClimates, Integer> getWeightMap()
|
|
||||||
{
|
|
||||||
return this.weightMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addWeight(BOPClimates climate, int weight)
|
|
||||||
{
|
|
||||||
this.weightMap.put(climate, weight);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void clearWeights()
|
|
||||||
{
|
|
||||||
this.weightMap.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
// whether or not a biome essence item corresponding to this biome should be able to drop from biome blocks
|
|
||||||
public boolean hasBiomeEssence()
|
|
||||||
{
|
|
||||||
return this.hasBiomeEssence;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFogColor(BlockPos pos) { return this.fogColor; }
|
|
||||||
|
|
||||||
public float getFogDensity(BlockPos pos) { return this.fogDensity; }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getSkyColorByTemp(float temperature)
|
|
||||||
{
|
|
||||||
return (this.skyColor == -1) ? super.getSkyColorByTemp(temperature) : this.skyColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Biome getBaseBiome()
|
|
||||||
{
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ResourceLocation getResourceLocation()
|
|
||||||
{
|
|
||||||
return this.location;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class PropsBuilder
|
|
||||||
{
|
|
||||||
private final String biomeName;
|
|
||||||
|
|
||||||
/**The colour of this biome as seen in guis**/
|
|
||||||
private int guiColour = 0xffffff;
|
|
||||||
private float baseHeight = 0.1F;
|
|
||||||
private float heightVariation = 0.2F;
|
|
||||||
private float temperature = 0.5F;
|
|
||||||
private float rainfall = 0.5F;
|
|
||||||
private int waterColor = 16777215;
|
|
||||||
private boolean enableSnow = false;
|
|
||||||
private boolean enableRain = true;
|
|
||||||
private String baseBiomeRegName;
|
|
||||||
|
|
||||||
public PropsBuilder(String name) { this.biomeName = name; }
|
|
||||||
|
|
||||||
public PropsBuilder withGuiColour(Integer colour) { if (colour != null) this.guiColour = colour; return this; }
|
|
||||||
public PropsBuilder withTemperature(Float temperature) { if (temperature != null) this.temperature = temperature; return this; }
|
|
||||||
public PropsBuilder withRainfall(Float rainfall) { if (rainfall != null) this.rainfall = rainfall; return this; }
|
|
||||||
public PropsBuilder withBaseHeight(Float baseHeight) { if (baseHeight != null) this.baseHeight = baseHeight; return this; }
|
|
||||||
public PropsBuilder withHeightVariation(Float heightVariation) { if (heightVariation != null) this.heightVariation = heightVariation; return this; }
|
|
||||||
public PropsBuilder withRainDisabled() { this.enableRain = false; return this; }
|
|
||||||
public PropsBuilder withSnowEnabled() { this.enableSnow = true; return this; }
|
|
||||||
public PropsBuilder withWaterColor(Integer waterColor) { if (waterColor != null) this.waterColor = waterColor; return this; }
|
|
||||||
public PropsBuilder withBaseBiome(String name) { if (name != null) this.baseBiomeRegName = name; return this; }
|
|
||||||
|
|
||||||
public BiomeProps build()
|
|
||||||
{
|
|
||||||
return new BiomeProps(this.biomeName, this.temperature, this.rainfall, this.baseHeight, this.heightVariation, this.enableRain, this.enableSnow, this.waterColor, this.baseBiomeRegName, this.guiColour);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class BiomeProps extends BiomeProperties
|
|
||||||
{
|
|
||||||
/**The colour of this biome as seen in guis**/
|
|
||||||
private int guiColour = 0xffffff;
|
|
||||||
|
|
||||||
private BiomeProps(String name, float temperature, float rainfall, float baseHeight, float heightVariation, boolean enableRain, boolean enableSnow, int waterColor, String baseBiomeRegName, int guiColour)
|
|
||||||
{
|
|
||||||
super(name);
|
|
||||||
|
|
||||||
this.setTemperature(temperature);
|
|
||||||
this.setRainfall(rainfall);
|
|
||||||
this.setBaseHeight(baseHeight);
|
|
||||||
this.setHeightVariation(heightVariation);
|
|
||||||
if (!enableRain) this.setRainDisabled();
|
|
||||||
if (enableSnow) this.setSnowEnabled();
|
|
||||||
this.setWaterColor(waterColor);
|
|
||||||
this.setBaseBiome(baseBiomeRegName);
|
|
||||||
|
|
||||||
this.guiColour = guiColour;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,181 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2017, 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.nether;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.config.IBOPWorldSettings;
|
|
||||||
import biomesoplenty.api.config.IBOPWorldSettings.GeneratorType;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.biome.BOPBiome;
|
|
||||||
import biomesoplenty.common.init.ModBiomes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorHive;
|
|
||||||
import biomesoplenty.core.BiomesOPlenty;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.monster.EntityEnderman;
|
|
||||||
import net.minecraft.entity.monster.EntityGhast;
|
|
||||||
import net.minecraft.entity.monster.EntityMagmaCube;
|
|
||||||
import net.minecraft.entity.monster.EntityPigZombie;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
|
|
||||||
public class BOPHellBiome extends BOPBiome
|
|
||||||
{
|
|
||||||
public IBlockState wallBlock = Blocks.NETHERRACK.getDefaultState();
|
|
||||||
public IBlockState roofTopBlock = Blocks.NETHERRACK.getDefaultState();
|
|
||||||
public IBlockState roofFillerBlock = Blocks.NETHERRACK.getDefaultState();
|
|
||||||
|
|
||||||
public BOPHellBiome(String idName, PropsBuilder defaultBuilder)
|
|
||||||
{
|
|
||||||
super(idName, defaultBuilder);
|
|
||||||
|
|
||||||
this.topBlock = Blocks.NETHERRACK.getDefaultState();
|
|
||||||
this.fillerBlock = Blocks.NETHERRACK.getDefaultState();
|
|
||||||
|
|
||||||
this.spawnableCaveCreatureList.clear();
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableMonsterList.clear();
|
|
||||||
this.spawnableWaterCreatureList.clear();
|
|
||||||
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityGhast.class, 50, 4, 4));
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityPigZombie.class, 100, 4, 4));
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityMagmaCube.class, 2, 4, 4));
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 1, 4, 4));
|
|
||||||
|
|
||||||
this.addGenerator("hive", GeneratorStage.PRE, (new GeneratorHive.Builder()).amountPerChunk(0.2F).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
super.configure(conf);
|
|
||||||
|
|
||||||
// Allow basic properties to be overridden
|
|
||||||
this.wallBlock = conf.getBlockState("wallBlock", this.wallBlock);
|
|
||||||
this.roofTopBlock = conf.getBlockState("roofTopBlock", this.roofTopBlock);
|
|
||||||
this.roofFillerBlock = conf.getBlockState("roofFillerBlock", this.roofFillerBlock);
|
|
||||||
|
|
||||||
// log any warnings from parsing the config file
|
|
||||||
for (String msg : conf.flushMessages())
|
|
||||||
BiomesOPlenty.logger.info(msg);
|
|
||||||
// write default values to a file
|
|
||||||
ModBiomes.writeDefaultConfigFile(ModBiomes.BOP_DEFAULTS_DIR, this.getResourceLocation().getResourcePath(), conf);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void applySettings(IBOPWorldSettings settings)
|
|
||||||
{
|
|
||||||
if (!settings.isEnabled(GeneratorType.GEMS)) {this.removeGenerator("ruby"); this.removeGenerator("topaz");
|
|
||||||
this.removeGenerator("amber"); this.removeGenerator("peridot"); this.removeGenerator("malachite");
|
|
||||||
this.removeGenerator("sapphire"); this.removeGenerator("tanzanite"); this.removeGenerator("amethyst");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.POISON_IVY)) {this.removeGenerator("poison_ivy");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.BERRY_BUSHES)) {this.removeGenerator("berry_bushes");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.NETHER_HIVES)) {this.removeGenerator("hive");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.THORNS)) {this.removeGenerator("thorns");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.QUICKSAND)) {this.removeGenerator("quicksand");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.HOT_SPRINGS)) {this.removeGenerator("hot_springs");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.LIQUID_POISON)) {this.removeGenerator("poison_lakes");}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double stoneNoiseVal)
|
|
||||||
{
|
|
||||||
IBlockState roof = this.roofTopBlock;
|
|
||||||
IBlockState roofFiller = this.roofFillerBlock;
|
|
||||||
IBlockState wall = this.wallBlock;
|
|
||||||
IBlockState floor = this.topBlock;
|
|
||||||
IBlockState floorFiller = this.fillerBlock;
|
|
||||||
|
|
||||||
int roofDepth = 4;
|
|
||||||
int floorDepth = 4;
|
|
||||||
|
|
||||||
int localX = x & 15;
|
|
||||||
int localZ = z & 15;
|
|
||||||
int localY = 127;
|
|
||||||
boolean lastSolid = true;
|
|
||||||
|
|
||||||
while (localY >= 0)
|
|
||||||
{
|
|
||||||
int blockSkip = 1;
|
|
||||||
IBlockState currentState = primer.getBlockState(localZ, localY, localX);
|
|
||||||
|
|
||||||
if (currentState.getBlock() == Blocks.NETHERRACK)
|
|
||||||
{
|
|
||||||
// initially set to the wall material. this may be replaced later by a roof
|
|
||||||
primer.setBlockState(localZ, localY, localX, wall);
|
|
||||||
|
|
||||||
// this must be a floor
|
|
||||||
if (!lastSolid)
|
|
||||||
{
|
|
||||||
primer.setBlockState(localZ, localY, localX, floor);
|
|
||||||
|
|
||||||
// iterate over the next few blocks and replace them with the floor material. skip those
|
|
||||||
// blocks too as we've already checked and modified them
|
|
||||||
for (int floorOffset = 1; floorOffset <= floorDepth - 1 && localY - floorOffset >= 0; floorOffset++)
|
|
||||||
{
|
|
||||||
IBlockState state = primer.getBlockState(localZ, localY - floorOffset, localX);
|
|
||||||
blockSkip = floorOffset + 1;
|
|
||||||
|
|
||||||
if (state.getBlock() == Blocks.NETHERRACK)
|
|
||||||
{
|
|
||||||
primer.setBlockState(localZ, localY - floorOffset, localX, floorFiller);
|
|
||||||
}
|
|
||||||
else break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// update lastSolid for next time
|
|
||||||
lastSolid = true;
|
|
||||||
}
|
|
||||||
else if (currentState.getMaterial() == Material.AIR)
|
|
||||||
{
|
|
||||||
// previous blocks must be a roof
|
|
||||||
if (lastSolid)
|
|
||||||
{
|
|
||||||
primer.setBlockState(localZ, localY + 1, localX, roof);
|
|
||||||
|
|
||||||
// iterate over the previous few blocks to replace them with the roof material
|
|
||||||
for (int roofOffset = 2; roofOffset <= roofDepth && localY + roofOffset <= 127; roofOffset++)
|
|
||||||
{
|
|
||||||
IBlockState state = primer.getBlockState(localZ, localY + roofOffset, localX);
|
|
||||||
|
|
||||||
// onllocalY replace netherrack or walls, if it's air or anything else then don't continue
|
|
||||||
if (state.getBlock() == Blocks.NETHERRACK || state == wall)
|
|
||||||
{
|
|
||||||
primer.setBlockState(localZ, localY + roofOffset, localX, roofFiller);
|
|
||||||
}
|
|
||||||
else break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// update lastSolid for next time
|
|
||||||
lastSolid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
localY -= blockSkip;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ResourceLocation getBeachLocation()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,42 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2017, 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.nether;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorBramble;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class BiomeCorruptedSands extends BOPHellBiome
|
|
||||||
{
|
|
||||||
public BiomeCorruptedSands()
|
|
||||||
{
|
|
||||||
super("corrupted_sands", new PropsBuilder("Corrupted Sands").withGuiColour(0xA93C3E).withTemperature(2.0F).withRainfall(0.0F).withRainDisabled());
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.HELL, 5);
|
|
||||||
|
|
||||||
this.topBlock = Blocks.SOUL_SAND.getDefaultState();
|
|
||||||
this.fillerBlock = Blocks.SOUL_SAND.getDefaultState();
|
|
||||||
this.wallBlock = Blocks.SOUL_SAND.getDefaultState();
|
|
||||||
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
|
|
||||||
IBlockPosQuery emptySoulsand = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create();
|
|
||||||
this.addGenerator("bramble", GeneratorStage.FLOWERS,(new GeneratorBramble.Builder()).amountPerChunk(40.0F).placeOn(emptySoulsand).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
|
|
||||||
// splatter top blocks
|
|
||||||
//this.addGenerator("netherrack_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(5.0F).generationAttempts(128).scatterYMethod(ScatterYMethod.NETHER_SURFACE).replace(emptySoulsand).with(Blocks.NETHERRACK.getDefaultState()).create());
|
|
||||||
this.addGenerator("dead_grass", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(5.0F).with(BOPPlants.DEADGRASS).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
this.addGenerator("thorns", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(3.0F).placeOn(emptySoulsand).with(BOPPlants.THORN).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,70 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2017, 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.nether;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorBigMushroom;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
|
|
||||||
public class BiomeFungiForest extends BOPHellBiome
|
|
||||||
{
|
|
||||||
public IBlockState usualTopBlock;
|
|
||||||
public IBlockState alternateTopBlock;
|
|
||||||
|
|
||||||
public BiomeFungiForest()
|
|
||||||
{
|
|
||||||
super("fungi_forest", new PropsBuilder("Fungi Forest").withGuiColour(0xA93C3E).withTemperature(2.0F).withRainfall(0.0F).withRainDisabled());
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.HELL, 5);
|
|
||||||
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.MYCELIAL_NETHERRACK);
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
IBlockPosQuery surfaceBlocks = BlockQuery.buildOr().states(this.topBlock).create();
|
|
||||||
this.addGenerator("glowshroom", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(1.5F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.GLOWSHROOM).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
this.addGenerator("flat_mushroom", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(1.0F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.FLAT_MUSHROOM).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
this.addGenerator("toadstools", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(1.0F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.TOADSTOOL).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(5.0F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(2.0F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
this.addGenerator("big_brown_mushroom", GeneratorStage.BIG_SHROOM,(new GeneratorBigMushroom.Builder()).amountPerChunk(2.0F).mushroomType(GeneratorBigMushroom.BigMushroomType.BROWN).scatterYMethod(ScatterYMethod.NETHER_SURFACE).placeOn(surfaceBlocks).create());
|
|
||||||
this.addGenerator("big_red_mushroom", GeneratorStage.BIG_SHROOM,(new GeneratorBigMushroom.Builder()).amountPerChunk(30.0F).mushroomType(GeneratorBigMushroom.BigMushroomType.RED).scatterYMethod(ScatterYMethod.NETHER_SURFACE).minHeight(5).maxHeight(10).placeOn(surfaceBlocks).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
super.configure(conf);
|
|
||||||
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = conf.getBlockState("alternateTopBlock", this.alternateTopBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
|
|
||||||
{
|
|
||||||
this.topBlock = (noise + rand.nextDouble() * 1.0D > 1.8D) ? this.alternateTopBlock : this.usualTopBlock;
|
|
||||||
super.genTerrainBlocks(world, rand, primer, x, z, noise);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2017, 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.nether;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class BiomePhantasmagoricInferno extends BOPHellBiome
|
|
||||||
{
|
|
||||||
public BiomePhantasmagoricInferno()
|
|
||||||
{
|
|
||||||
super("phantasmagoric_inferno", new PropsBuilder("Phantasmagoric Inferno").withGuiColour(0xA93C3E).withTemperature(2.0F).withRainfall(0.0F).withRainDisabled());
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.HELL, 5);
|
|
||||||
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.ash_block.getDefaultState();
|
|
||||||
this.fillerBlock = BOPBlocks.ash_block.getDefaultState();
|
|
||||||
|
|
||||||
// lava lakes
|
|
||||||
this.addGenerator("lava_lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(4.0F).liquid(Blocks.LAVA).frozenLiquid((IBlockState)null).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
|
|
||||||
// splatter top blocks
|
|
||||||
IBlockPosQuery emptyAsh = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create();
|
|
||||||
|
|
||||||
this.addGenerator("fire", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(2.5F).with(Blocks.FIRE.getDefaultState()).placeOn(emptyAsh).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
this.addGenerator("blue_fire", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(2.5F).with(BOPBlocks.blue_fire.getDefaultState()).placeOn(emptyAsh).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,74 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2017, 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.nether;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLeaves;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLog;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplatter;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorVines;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class BiomeUndergarden extends BOPHellBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeUndergarden()
|
|
||||||
{
|
|
||||||
super("undergarden", new PropsBuilder("Undergarden").withGuiColour(0xA93C3E).withTemperature(2.0F).withRainfall(0.0F).withRainDisabled());
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.HELL, 5);
|
|
||||||
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.OVERGROWN_NETHERRACK);
|
|
||||||
|
|
||||||
// splatter top blocks
|
|
||||||
IBlockPosQuery emptyOvergrownNetherrack = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create();
|
|
||||||
this.addGenerator("netherrack_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(7.0F).generationAttempts(128).scatterYMethod(ScatterYMethod.NETHER_SURFACE).replace(emptyOvergrownNetherrack).with(Blocks.NETHERRACK.getDefaultState()).create());
|
|
||||||
|
|
||||||
IBlockPosQuery suitableNetherrackPosition = BlockQuery.buildAnd().withAltitudeBetween(70, 120).states(Blocks.NETHERRACK.getDefaultState()).create();
|
|
||||||
this.addGenerator("ivy", GeneratorStage.FLOWERS,(new GeneratorVines.Builder()).amountPerChunk(25.0F).generationAttempts(128).placeOn(suitableNetherrackPosition).with(BOPBlocks.ivy.getDefaultState()).minHeight(8).maxHeight(20).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(1.0F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("burning_blossom", 4, (new GeneratorFlora.Builder().scatterYMethod(ScatterYMethod.NETHER_SURFACE).with(BOPFlowers.BURNING_BLOSSOM).create()));
|
|
||||||
|
|
||||||
// trees
|
|
||||||
IBlockPosQuery surfaceBlocks = BlockQuery.buildOr().states(this.topBlock, BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.OVERGROWN_NETHERRACK)).create();
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(15.0F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("twiglet", 5, (new GeneratorTwigletTree.Builder()).scatterYMethod(ScatterYMethod.NETHER_SURFACE).placeOn(surfaceBlocks).minHeight(2).maxHeight(2).log(BlockBOPLog.paging.getVariantState(BOPWoods.HELLBARK)).leaves(BlockBOPLeaves.paging.getVariantState(BOPTrees.HELLBARK)).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(15.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("devilweed", 5, (new GeneratorGrass.Builder()).with(BOPPlants.DEVILWEED).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("flat_mushroom", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).generationAttempts(16).scatterYMethod(ScatterYMethod.NETHER_SURFACE).with(BlockBOPMushroom.MushroomType.FLAT_MUSHROOM).create());
|
|
||||||
this.addGenerator("toadstools", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(1.5F).generationAttempts(16).scatterYMethod(ScatterYMethod.NETHER_SURFACE).with(BlockBOPMushroom.MushroomType.TOADSTOOL).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(2.0F).generationAttempts(16).scatterYMethod(ScatterYMethod.NETHER_SURFACE).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(1.0F).generationAttempts(16).scatterYMethod(ScatterYMethod.NETHER_SURFACE).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2017, 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.nether;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import net.minecraft.block.BlockBone;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
|
|
||||||
public class BiomeVisceralHeap extends BOPHellBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeVisceralHeap()
|
|
||||||
{
|
|
||||||
super("visceral_heap", new PropsBuilder("Visceral Heap").withGuiColour(0xA93C3E).withTemperature(2.0F).withRainfall(0.0F).withRainDisabled());
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.HELL, 5);
|
|
||||||
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.flesh.getDefaultState();
|
|
||||||
this.fillerBlock = BOPBlocks.flesh.getDefaultState();
|
|
||||||
this.wallBlock = BOPBlocks.flesh.getDefaultState();
|
|
||||||
|
|
||||||
// blood pools
|
|
||||||
this.addGenerator("blood_pools", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(6.0F).liquid(BOPBlocks.blood).frozenLiquid((IBlockState)null).scatterYMethod(ScatterYMethod.NETHER_SURFACE).create());
|
|
||||||
|
|
||||||
IBlockPosQuery emptyFlesh = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create();
|
|
||||||
this.addGenerator("bones", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(1.5F).placeOn(emptyFlesh).scatterYMethod(ScatterYMethod.NETHER_SURFACE).with(Blocks.BONE_BLOCK.getDefaultState().withProperty(BlockBone.AXIS, EnumFacing.Axis.Y)).minHeight(1).maxHeight(4).create());
|
|
||||||
this.addGenerator("eyebulbs", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).generationAttempts(16).amountPerChunk(1.0F).scatterYMethod(ScatterYMethod.NETHER_SURFACE).with(BlockBOPDoublePlant.DoublePlantType.EYEBULB).create());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,225 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.config.IBOPWorldSettings;
|
|
||||||
import biomesoplenty.api.config.IBOPWorldSettings.GeneratorType;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.biome.BOPBiome;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.init.ModBiomes;
|
|
||||||
import biomesoplenty.common.util.biome.BiomeUtils;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.TerrainSettings;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.core.BiomesOPlenty;
|
|
||||||
import net.minecraft.block.BlockSand;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.init.Biomes;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.ResourceLocation;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
|
|
||||||
public class BOPOverworldBiome extends BOPBiome
|
|
||||||
{
|
|
||||||
public IBlockState seaFloorBlock = Blocks.DIRT.getDefaultState();
|
|
||||||
|
|
||||||
public boolean canSpawnInBiome = true;
|
|
||||||
public boolean canGenerateVillages = true;
|
|
||||||
public boolean canGenerateRivers = true;
|
|
||||||
|
|
||||||
public ResourceLocation beachBiomeLocation = BiomeUtils.getLocForBiome(Biomes.BEACH);
|
|
||||||
|
|
||||||
public TerrainSettings terrainSettings = new TerrainSettings();
|
|
||||||
public boolean noNeighborTerrainInfuence = false;
|
|
||||||
public int avgDirtDepth = 3;
|
|
||||||
|
|
||||||
public BOPOverworldBiome(String idName, PropsBuilder defaultBuilder)
|
|
||||||
{
|
|
||||||
super(idName, defaultBuilder);
|
|
||||||
|
|
||||||
this.terrainSettings.setDefaults();
|
|
||||||
|
|
||||||
// roots
|
|
||||||
this.addGenerator("roots", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(4.0F).with(BOPPlants.ROOT).create());
|
|
||||||
|
|
||||||
IBlockPosQuery suitableStonePosition = BlockQuery.buildAnd().withAltitudeBetween(0, 55).blocks(Blocks.STONE).create();
|
|
||||||
this.addGenerator("miners_delight", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.25F).generationAttempts(64).with(BOPFlowers.MINERS_DELIGHT).placeOn(suitableStonePosition).scatterYMethod(ScatterYMethod.BELOW_GROUND).create());
|
|
||||||
this.addGenerator("glowshrooms", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.5F).generationAttempts(64).placeOn(suitableStonePosition).with(BOPBlocks.mushroom.getDefaultState().withProperty(BlockBOPMushroom.VARIANT, BlockBOPMushroom.MushroomType.GLOWSHROOM)).scatterYMethod(ScatterYMethod.BELOW_GROUND).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void applySettings(IBOPWorldSettings settings)
|
|
||||||
{
|
|
||||||
if (!settings.isEnabled(GeneratorType.GEMS)) {this.removeGenerator("ruby"); this.removeGenerator("topaz");
|
|
||||||
this.removeGenerator("amber"); this.removeGenerator("peridot"); this.removeGenerator("malachite");
|
|
||||||
this.removeGenerator("sapphire"); this.removeGenerator("tanzanite"); this.removeGenerator("amethyst");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.POISON_IVY)) {this.removeGenerator("poison_ivy");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.BERRY_BUSHES)) {this.removeGenerator("berry_bushes");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.NETHER_HIVES)) {this.removeGenerator("hive");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.THORNS)) {this.removeGenerator("thorns");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.QUICKSAND)) {this.removeGenerator("quicksand");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.HOT_SPRINGS)) {this.removeGenerator("hot_springs");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.LIQUID_POISON)) {this.removeGenerator("poison_lakes");}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
super.configure(conf);
|
|
||||||
// Allow basic properties to be overridden
|
|
||||||
|
|
||||||
this.seaFloorBlock = conf.getBlockState("seaFloorBlock", this.seaFloorBlock);
|
|
||||||
|
|
||||||
this.terrainSettings.avgHeight = conf.getFloat("averageHeight", (float)this.terrainSettings.avgHeight);
|
|
||||||
this.terrainSettings.variationBelow = conf.getFloat("variationBelow", (float)this.terrainSettings.variationBelow);
|
|
||||||
this.terrainSettings.variationAbove = conf.getFloat("variationAbove", (float)this.terrainSettings.variationAbove);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = conf.getBool("canSpawnInBiome", this.canSpawnInBiome);
|
|
||||||
this.canGenerateVillages = conf.getBool("canGenerateVillages", this.canGenerateVillages);
|
|
||||||
this.canGenerateRivers = conf.getBool("canGenerateRivers", this.canGenerateRivers);
|
|
||||||
|
|
||||||
this.beachBiomeLocation = conf.getResourceLocation("beachBiomeLocation", this.beachBiomeLocation);
|
|
||||||
|
|
||||||
// log any warnings from parsing the config file
|
|
||||||
for (String msg : conf.flushMessages())
|
|
||||||
BiomesOPlenty.logger.info(msg);
|
|
||||||
// write default values to a file
|
|
||||||
ModBiomes.writeDefaultConfigFile(ModBiomes.BOP_DEFAULTS_DIR, this.getResourceLocation().getResourcePath(), conf);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double stoneNoiseVal)
|
|
||||||
{
|
|
||||||
IBlockState topBlock = this.topBlock;
|
|
||||||
IBlockState fillerBlock = this.fillerBlock;
|
|
||||||
IBlockState seaFloorBlock = this.seaFloorBlock;
|
|
||||||
|
|
||||||
boolean hitFloorYet = false;
|
|
||||||
int topBlocksToFill = 0;
|
|
||||||
int dirtBlocksToFill = 0;
|
|
||||||
int seaFloorBlocksToFill = 0;
|
|
||||||
int dirtDepth = Math.max(0, (int)(stoneNoiseVal / 3.0D + this.avgDirtDepth + rand.nextDouble() * 0.25D));
|
|
||||||
int seaFloorDepth = 1 + rand.nextInt(2);
|
|
||||||
|
|
||||||
int localX = x & 15;
|
|
||||||
int localZ = z & 15;
|
|
||||||
|
|
||||||
// start at the top and move downwards
|
|
||||||
for (int y = 255; y >= 0; --y)
|
|
||||||
{
|
|
||||||
|
|
||||||
IBlockState state = primer.getBlockState(localZ, y, localX);
|
|
||||||
|
|
||||||
// bedrock at the bottom
|
|
||||||
if (y <= rand.nextInt(5))
|
|
||||||
{
|
|
||||||
primer.setBlockState(localZ, y, localX, Blocks.BEDROCK.getDefaultState());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.getMaterial() == Material.AIR)
|
|
||||||
{
|
|
||||||
// topBlocks and dirtBlocks can occur after any pocket of air
|
|
||||||
topBlocksToFill = (topBlock == null ? 0 : 1);
|
|
||||||
dirtBlocksToFill = dirtDepth;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if (!hitFloorYet && state.getMaterial() == Material.WATER)
|
|
||||||
{
|
|
||||||
// seaFloorBlocks can occur after surface water
|
|
||||||
seaFloorBlocksToFill = seaFloorDepth;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.getBlock() == Blocks.STONE)
|
|
||||||
{
|
|
||||||
hitFloorYet = true;
|
|
||||||
if (topBlocksToFill > 0)
|
|
||||||
{
|
|
||||||
if (y >= 62)
|
|
||||||
{
|
|
||||||
primer.setBlockState(localZ, y, localX, topBlock);
|
|
||||||
}
|
|
||||||
else if (y >= 56 - dirtDepth)
|
|
||||||
{
|
|
||||||
primer.setBlockState(localZ, y, localX, fillerBlock);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
primer.setBlockState(localZ, y, localX, Blocks.GRAVEL.getDefaultState());
|
|
||||||
dirtBlocksToFill = 0;
|
|
||||||
}
|
|
||||||
topBlocksToFill--;
|
|
||||||
}
|
|
||||||
else if (seaFloorBlocksToFill > 0)
|
|
||||||
{
|
|
||||||
primer.setBlockState(localZ, y, localX, seaFloorBlock);
|
|
||||||
--seaFloorBlocksToFill;
|
|
||||||
}
|
|
||||||
else if (dirtBlocksToFill > 0)
|
|
||||||
{
|
|
||||||
primer.setBlockState(localZ, y, localX, fillerBlock);
|
|
||||||
--dirtBlocksToFill;
|
|
||||||
|
|
||||||
// add sandstone after a patch of sand
|
|
||||||
if (dirtBlocksToFill == 0 && fillerBlock.getBlock() == Blocks.SAND)
|
|
||||||
{
|
|
||||||
dirtBlocksToFill = rand.nextInt(4) + Math.max(0, y - 63);
|
|
||||||
fillerBlock = fillerBlock.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND ? Blocks.RED_SANDSTONE.getDefaultState() : Blocks.SANDSTONE.getDefaultState();
|
|
||||||
}
|
|
||||||
if (dirtBlocksToFill == 0 && fillerBlock.getBlock() == BOPBlocks.white_sand)
|
|
||||||
{
|
|
||||||
dirtBlocksToFill = rand.nextInt(4) + Math.max(0, y - 63);
|
|
||||||
fillerBlock = BOPBlocks.white_sandstone.getDefaultState();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ResourceLocation getBeachLocation()
|
|
||||||
{
|
|
||||||
return this.beachBiomeLocation;
|
|
||||||
}
|
|
||||||
|
|
||||||
// the below two methods convert between our values and Vanilla.
|
|
||||||
// they're mostly used for mods like Pioneer rather than us.
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getBaseHeight()
|
|
||||||
{
|
|
||||||
return ((float)this.terrainSettings.avgHeight - 65.0F) / 17.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getHeightVariation()
|
|
||||||
{
|
|
||||||
// average the heightVariation values for above and below
|
|
||||||
return Math.abs((((float)this.terrainSettings.variationAbove - 7.0F) / (20.0F * 4.0F) + ((float)this.terrainSettings.variationBelow - 4.0F) / 20.0F) / 2.0F);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,93 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 com.google.common.base.CaseFormat;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTaigaTree;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.passive.EntityLlama;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class BiomeGenAlps extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public enum AlpsType {ALPS, ALPS_FOOTHILLS}
|
|
||||||
|
|
||||||
public AlpsType type;
|
|
||||||
|
|
||||||
public BiomeGenAlps(AlpsType type)
|
|
||||||
{
|
|
||||||
super(type.name().toLowerCase(), new PropsBuilder(CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, type.toString())).withGuiColour(13421772).withSnowEnabled().withTemperature(-0.25F).withRainfall(0.3F));
|
|
||||||
|
|
||||||
this.type = type;
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case ALPS:
|
|
||||||
this.terrainSettings.avgHeight(198).heightVariation(12, 12).octaves(1, 1, 2, 2, 3, 3);
|
|
||||||
this.topBlock = Blocks.SNOW.getDefaultState();
|
|
||||||
this.fillerBlock = Blocks.SNOW.getDefaultState();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ALPS_FOOTHILLS:
|
|
||||||
this.terrainSettings.avgHeight(120).heightVariation(48, 64).octaves(0, 1, 1, 3, 1, 0);
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.OVERGROWN_STONE);
|
|
||||||
this.fillerBlock = Blocks.STONE.getDefaultState();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
if (type == AlpsType.ALPS)
|
|
||||||
{
|
|
||||||
this.addWeight(BOPClimates.TUNDRA, 3);
|
|
||||||
this.addWeight(BOPClimates.ICE_CAP, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.avgDirtDepth = 8;
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
if (type == AlpsType.ALPS_FOOTHILLS)
|
|
||||||
{
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityLlama.class, 5, 4, 6));
|
|
||||||
|
|
||||||
IBlockPosQuery emptyStone = BlockQuery.buildAnd().withAirAbove().states(BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.OVERGROWN_STONE)).create();
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(0.5F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("fir", 1, (new GeneratorTaigaTree.Builder()).placeOn(emptyStone).log(BOPWoods.FIR).leaves(BOPTrees.FIR).minHeight(10).maxHeight(19).create());
|
|
||||||
|
|
||||||
// hot springs
|
|
||||||
this.addGenerator("hot_springs", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.5F).liquid(BOPBlocks.hot_spring_water).frozenLiquid((IBlockState)null).scatterYMethod(ScatterYMethod.AT_SURFACE).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("emeralds", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(Blocks.EMERALD_ORE.getDefaultState()).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,129 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPPlant;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBulbTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
|
||||||
import net.minecraft.block.BlockDirt;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.passive.EntityOcelot;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
|
|
||||||
public class BiomeGenBambooForest extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public IBlockState usualTopBlock;
|
|
||||||
public IBlockState alternateTopBlock;
|
|
||||||
|
|
||||||
public BiomeGenBambooForest()
|
|
||||||
{
|
|
||||||
super("bamboo_forest", new PropsBuilder("Bamboo Forest").withGuiColour(0xA3E053).withRainfall(0.85F).withTemperature(0.9F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(68).heightVariation(5, 10);
|
|
||||||
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.TROPICAL, 3);
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1));
|
|
||||||
|
|
||||||
this.topBlock = Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL);
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = Blocks.GRASS.getDefaultState();
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.5F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(30);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("bamboo", 3, (new GeneratorBulbTree.Builder()).minHeight(10).maxHeight(20).log(BOPBlocks.bamboo.getDefaultState()).leaves(BOPTrees.BAMBOO).create());
|
|
||||||
treeGenerator.add("bamboo_thin", 1, (new GeneratorTwigletTree.Builder()).minHeight(5).maxHeight(10).leafChance(0.3F).log(BOPBlocks.bamboo.getDefaultState()).leaves(BOPTrees.BAMBOO).create());
|
|
||||||
//treeGenerator.add("oak_bush", 1, (new GeneratorBush.Builder()).maxHeight(2).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(2.6F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("doublegrass", 2, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.GRASS).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(3.0F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).create());
|
|
||||||
this.addGenerator("ferns", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(4.0F).with(BlockTallGrass.EnumType.FERN).create());
|
|
||||||
this.addGenerator("river_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(5.0F).generationAttempts(24).placeOn(BlockQueries.litFertileWaterside).with(BlockBOPPlant.paging.getVariantState(BOPPlants.RIVERCANE)).minHeight(1).maxHeight(3).create());
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(4.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.BUSH).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("topaz", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TOPAZ).create());
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
super.configure(conf);
|
|
||||||
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = conf.getBlockState("alternateTopBlock", this.alternateTopBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
|
|
||||||
{
|
|
||||||
this.topBlock = (noise + rand.nextDouble() * 3.0D > 1.8D) ? this.alternateTopBlock : this.usualTopBlock;
|
|
||||||
super.genTerrainBlocks(world, rand, primer, x, z, noise);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0xBBDD54);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0xBBDD54);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,136 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLilypad;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplatter;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBayouTree;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.monster.EntitySlime;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenBayou extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenBayou()
|
|
||||||
{
|
|
||||||
super("bayou", new PropsBuilder("Bayou").withGuiColour(0x7DAD51).withTemperature(0.95F).withRainfall(0.9F).withWaterColor(0xFFD932));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(62).heightVariation(6, 3).octaves(1, 1, 1, 1, 0, 0).sidewaysNoise(0.0F);
|
|
||||||
|
|
||||||
//this.skyColor = 0xACC4BC;
|
|
||||||
this.seaFloorBlock = BOPBlocks.mud.getDefaultState();
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.HOT_SWAMP, 10);
|
|
||||||
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));
|
|
||||||
|
|
||||||
// mud
|
|
||||||
IBlockPosQuery emptyGrassOrDirt = BlockQuery.buildAnd().withAirAbove().states(this.topBlock, this.fillerBlock).create();
|
|
||||||
this.addGenerator("mud", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(1).maxRadius(3).with(BOPBlocks.mud.getDefaultState()).create());
|
|
||||||
this.addGenerator("mud_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(0.2F).replace(emptyGrassOrDirt).with(BOPBlocks.mud.getDefaultState()).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(8);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("willow", 3, (new GeneratorBayouTree.Builder()).log(BOPWoods.WILLOW).leaves(BOPTrees.WILLOW).minHeight(6).maxHeight(12).minLeavesRadius(1).leavesGradient(2).create());
|
|
||||||
treeGenerator.add("willow_large", 1, (new GeneratorBayouTree.Builder()).log(BOPWoods.WILLOW).leaves(BOPTrees.WILLOW).minHeight(10).maxHeight(18).minLeavesRadius(2).leavesGradient(3).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(2.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("doublegrass", 1, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.GRASS).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BOPPlants.KORU).create());
|
|
||||||
this.addGenerator("cattail", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(6.0F).with(BOPPlants.CATTAIL).create());
|
|
||||||
this.addGenerator("double_cattail", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(8.0F).with(BlockBOPDoublePlant.DoublePlantType.TALL_CATTAIL).create());
|
|
||||||
this.addGenerator("sugar_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(3.0F).generationAttempts(24).placeOn(BlockQueries.litFertileWaterside).with(Blocks.REEDS.getDefaultState()).minHeight(1).maxHeight(3).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(2.5F).with(Blocks.WATERLILY.getDefaultState()).create());
|
|
||||||
this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(2.0F).with(BlockBOPLilypad.LilypadType.MEDIUM).create());
|
|
||||||
this.addGenerator("flower_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.25F).with(BlockBOPLilypad.LilypadType.FLOWER).create());
|
|
||||||
this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(1.5F).with(BlockBOPLilypad.LilypadType.SMALL).create());
|
|
||||||
this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(1.5F).with(BlockBOPLilypad.LilypadType.TINY).create());
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(4.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.8F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("flat_mushroom", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.FLAT_MUSHROOM).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x7DAD51);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x9DDD66);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,194 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.block.BlockBOPPlant;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorBigMushroom;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.monster.EntitySlime;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenBog extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public IBlockState usualTopBlock;
|
|
||||||
public IBlockState alternateTopBlock;
|
|
||||||
|
|
||||||
public BiomeGenBog()
|
|
||||||
{
|
|
||||||
super("bog", new PropsBuilder("Bog").withGuiColour(0xD8935F).withTemperature(0.5F).withRainfall(0.9F).withWaterColor(0xBCFF96));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(63).heightVariation(5, 1).octaves(1, 4, 3, 1, 1, 0);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.LOAMY);
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.LOAMY).withProperty(BlockBOPDirt.COARSE, true);
|
|
||||||
this.seaFloorBlock = BOPBlocks.mud.getDefaultState();
|
|
||||||
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COLD_SWAMP, 7);
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));
|
|
||||||
|
|
||||||
// lakes
|
|
||||||
this.addGenerator("lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(1.0F).waterLakeForBiome(this).create());
|
|
||||||
this.addGenerator("poison_lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.1F).liquid(BOPBlocks.poison).frozenLiquid((IBlockState)null).create());
|
|
||||||
|
|
||||||
// mud
|
|
||||||
this.addGenerator("mud", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(4).maxRadius(7).with(BOPBlocks.mud.getDefaultState()).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(2);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("oak_tree", 1, (new GeneratorBigTree.Builder()).foliageHeight(1).maxHeight(15).create());
|
|
||||||
treeGenerator.add("dark_oak_twiglet", 5, (new GeneratorTwigletTree.Builder()).log(BlockPlanks.EnumType.DARK_OAK).leaves(BlockPlanks.EnumType.DARK_OAK).minHeight(1).maxHeight(4).leafChance(0.3F, 0.9F).create());
|
|
||||||
treeGenerator.add("oak_twiglet", 6, (new GeneratorTwigletTree.Builder()).minHeight(2).maxHeight(5).leafChance(0.3F, 0.9F).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(0.75F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.KORU).create());
|
|
||||||
this.addGenerator("bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(3.0F).with(BOPPlants.BUSH).create());
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.4F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
this.addGenerator("poison_ivy", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BOPPlants.POISONIVY).create());
|
|
||||||
this.addGenerator("cattail", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.CATTAIL).create());
|
|
||||||
this.addGenerator("double_cattail", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPDoublePlant.DoublePlantType.TALL_CATTAIL).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("flat_mushroom", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(1.25F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.FLAT_MUSHROOM).create());
|
|
||||||
this.addGenerator("blue_milk_caps", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.BLUE_MILK_CAP).create());
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(2.0F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(1.0F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("toadstools", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.TOADSTOOL).create());
|
|
||||||
|
|
||||||
this.addGenerator("big_brown_mushroom", GeneratorStage.BIG_SHROOM,(new GeneratorBigMushroom.Builder()).amountPerChunk(0.2F).minHeight(4).maxHeight(5).mushroomType(GeneratorBigMushroom.BigMushroomType.BROWN).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
super.configure(conf);
|
|
||||||
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = conf.getBlockState("alternateTopBlock", this.alternateTopBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
|
|
||||||
{
|
|
||||||
this.topBlock = (noise + rand.nextDouble() * 1.0D > 1.9D) ? this.alternateTopBlock : this.usualTopBlock;
|
|
||||||
|
|
||||||
double d0 = GRASS_COLOR_NOISE.getValue((double)x * 0.25D, (double)z * 0.25D);
|
|
||||||
|
|
||||||
if (d0 > 0.0D)
|
|
||||||
{
|
|
||||||
int i = x & 15;
|
|
||||||
int j = z & 15;
|
|
||||||
|
|
||||||
for (int k = 255; k >= 0; --k)
|
|
||||||
{
|
|
||||||
if (primer.getBlockState(j, k, i).getMaterial() != Material.AIR)
|
|
||||||
{
|
|
||||||
if (k == 62 && primer.getBlockState(j, k, i).getBlock() != Blocks.WATER)
|
|
||||||
{
|
|
||||||
primer.setBlockState(j, k, i, WATER);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
super.genTerrainBlocks(world, rand, primer, x, z, noise);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0xC1997C);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x9DAF60);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,101 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBush;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTaigaTree;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityRabbit;
|
|
||||||
import net.minecraft.entity.passive.EntityWolf;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenBorealForest extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenBorealForest()
|
|
||||||
{
|
|
||||||
super("boreal_forest", new PropsBuilder("Boreal Forest").withGuiColour(0x9FB771).withTemperature(0.3F).withRainfall(0.6F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(70).heightVariation(15, 30);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.BOREAL, 5);
|
|
||||||
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
||||||
|
|
||||||
// sand and gravel
|
|
||||||
this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(6).maxRadius(7).with(Blocks.GRAVEL.getDefaultState()).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(8);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("oak", 3, (new GeneratorBasicTree.Builder()).create());
|
|
||||||
treeGenerator.add("yellow_autumn", 4, (new GeneratorBigTree.Builder()).log(BlockPlanks.EnumType.BIRCH).leaves(BOPTrees.YELLOW_AUTUMN).foliageHeight(2).maxHeight(13).create());
|
|
||||||
treeGenerator.add("spruce", 5, (new GeneratorTaigaTree.Builder()).minHeight(10).maxHeight(19).create()); // TODO: implement pine cones
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.75F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("fern", 4, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.FERN).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.2F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.75F).with(BOPPlants.BUSH).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.0F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
this.addGenerator("poison_ivy", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BOPPlants.POISONIVY).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.25F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("amber", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.AMBER).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x9FB771);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0xC9CE65);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,106 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.passive.EntityRabbit;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenBrushland extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenBrushland()
|
|
||||||
{
|
|
||||||
super("brushland", new PropsBuilder("Brushland").withGuiColour(0xC6C19B).withTemperature(1.5F).withRainfall(0.1F).withRainDisabled());
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(66).heightVariation(3, 20);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SANDY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SANDY);
|
|
||||||
this.addWeight(BOPClimates.SAVANNA, 10);
|
|
||||||
|
|
||||||
this.canGenerateVillages = true;
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
||||||
|
|
||||||
//sand
|
|
||||||
this.addGenerator("sand", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(4).maxRadius(7).with(Blocks.SAND.getDefaultState()).create());
|
|
||||||
|
|
||||||
// quicksand
|
|
||||||
this.addGenerator("quicksand", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.2F).liquid(BOPBlocks.sand).frozenLiquid((IBlockState)null).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(6.0F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("brush", 1, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.ACACIA).leaves(BlockPlanks.EnumType.ACACIA).minHeight(3).maxHeight(5).leafLayers(2).create());
|
|
||||||
treeGenerator.add("brush_twiglet", 2, (new GeneratorTwigletTree.Builder()).minHeight(1).maxHeight(2).log(BOPWoods.EBONY).leaves(BOPTrees.EBONY).create());
|
|
||||||
treeGenerator.add("jungle_twiglet", 1, (new GeneratorTwigletTree.Builder()).minHeight(2).maxHeight(2).log(BlockPlanks.EnumType.JUNGLE).leaves(BlockPlanks.EnumType.JUNGLE).trunkFruit(Blocks.COCOA.getDefaultState()).create());
|
|
||||||
treeGenerator.add("brush_bush", 3, (new GeneratorFlora.Builder()).placeOn(this.topBlock).replace(Material.AIR).withNonDecayingLeaf(BlockPlanks.EnumType.OAK).generationAttempts(8).create());
|
|
||||||
treeGenerator.add("decaying_tree", 2, (new GeneratorBigTree.Builder()).amountPerChunk(1.0F).log(BOPWoods.EBONY).leaves(BOPTrees.EBONY).minHeight(4).maxHeight(10).foliageHeight(1).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(9.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.25F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("thorns", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.25F).with(BOPPlants.THORN).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("ruby", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.RUBY).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0xC6C19B);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0xB3BA73);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,143 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplotches;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.passive.EntityDonkey;
|
|
||||||
import net.minecraft.entity.passive.EntityHorse;
|
|
||||||
import net.minecraft.entity.passive.EntityRabbit;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
|
|
||||||
public class BiomeGenChaparral extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public IBlockState usualTopBlock;
|
|
||||||
public IBlockState usualFillerBlock;
|
|
||||||
public IBlockState alternateTopBlock;
|
|
||||||
public IBlockState alternateFillerBlock;
|
|
||||||
|
|
||||||
public BiomeGenChaparral()
|
|
||||||
{
|
|
||||||
super("chaparral", new PropsBuilder("Chaparral").withGuiColour(0xC4D675).withTemperature(0.8F).withRainfall(0.4F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(80).heightVariation(10, 20);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.MEDITERANEAN, 10);
|
|
||||||
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.usualFillerBlock = this.fillerBlock;
|
|
||||||
this.alternateTopBlock = Blocks.STONE.getDefaultState();
|
|
||||||
this.alternateFillerBlock = Blocks.STONE.getDefaultState();
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 1, 2, 6));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityDonkey.class, 1, 1, 1));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
||||||
|
|
||||||
this.canGenerateVillages = true;
|
|
||||||
|
|
||||||
// sand
|
|
||||||
this.addGenerator("sand", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(3).maxRadius(7).with(Blocks.SAND.getDefaultState()).create());
|
|
||||||
|
|
||||||
// stone patches
|
|
||||||
IBlockPosQuery emptyStoneOrGrass = BlockQuery.buildAnd().withAirAbove().states(this.topBlock, Blocks.STONE.getDefaultState()).create();
|
|
||||||
this.addGenerator("stone_patches", GeneratorStage.SAND, (new GeneratorSplotches.Builder()).amountPerChunk(4).splotchSize(15).replace(emptyStoneOrGrass).with(BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.OVERGROWN_STONE)).scatterYMethod(ScatterYMethod.AT_SURFACE).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.5F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("rose", 8, (new GeneratorDoubleFlora.Builder()).amountPerChunk(1).with(BlockDoublePlant.EnumPlantType.ROSE).create());
|
|
||||||
flowerGenerator.add("syringa", 4, (new GeneratorDoubleFlora.Builder()).amountPerChunk(1).with(BlockDoublePlant.EnumPlantType.SYRINGA).create());
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.5F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(7.0F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("twiglet", 3, (new GeneratorTwigletTree.Builder()).minHeight(2).maxHeight(2).log(BlockPlanks.EnumType.OAK).leaves(BlockPlanks.EnumType.OAK).create());
|
|
||||||
treeGenerator.add("small_bush", 1, (new GeneratorFlora.Builder()).placeOn(this.topBlock).replace(Material.AIR).withNonDecayingLeaf(BlockPlanks.EnumType.OAK).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("berry_bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.BERRYBUSH).create());
|
|
||||||
this.addGenerator("bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.75F).with(BOPPlants.BUSH).create());
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.0F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("peridot", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.PERIDOT).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
super.configure(conf);
|
|
||||||
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.usualFillerBlock = this.fillerBlock;
|
|
||||||
this.alternateTopBlock = conf.getBlockState("alternateTopBlock", this.alternateTopBlock);
|
|
||||||
this.alternateFillerBlock = conf.getBlockState("alternateFillerBlock", this.alternateFillerBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
|
|
||||||
{
|
|
||||||
this.topBlock = (noise + rand.nextDouble() * 1.0D > 2.0D) ? this.alternateTopBlock : this.usualTopBlock;
|
|
||||||
this.fillerBlock = (noise + rand.nextDouble() * 1.0D > 2.0D) ? this.alternateFillerBlock : this.usualFillerBlock;
|
|
||||||
super.genTerrainBlocks(world, rand, primer, x, z, noise);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0xC4D675);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,110 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLilypad;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class BiomeGenCherryBlossomGrove extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenCherryBlossomGrove()
|
|
||||||
{
|
|
||||||
super("cherry_blossom_grove", new PropsBuilder("Cherry Blossom Grove").withGuiColour(0xF88F8F).withTemperature(0.55F).withRainfall(0.8F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(63).heightVariation(5, 25).sidewaysNoise(0.8F);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SILTY);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COOL_TEMPERATE, 2);
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(2.3F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("pink_daffodil", 4, (new GeneratorFlora.Builder().with(BOPFlowers.PINK_DAFFODIL).create()));
|
|
||||||
flowerGenerator.add("white_anemones", 3, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE).create()));
|
|
||||||
flowerGenerator.add("clover", 2, (new GeneratorFlora.Builder().with(BOPFlowers.CLOVER).create()));
|
|
||||||
flowerGenerator.add("syringa", 2, (new GeneratorDoubleFlora.Builder().with(BlockDoublePlant.EnumPlantType.SYRINGA).create()));
|
|
||||||
flowerGenerator.add("houstonia", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.HOUSTONIA).create()));
|
|
||||||
flowerGenerator.add("oxeye_daisy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(3.0F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("pink_cherry", 2, (new GeneratorBasicTree.Builder()).log(BOPWoods.CHERRY).leaves(BOPTrees.PINK_CHERRY).create());
|
|
||||||
treeGenerator.add("white_cherry", 1, (new GeneratorBasicTree.Builder()).log(BOPWoods.CHERRY).leaves(BOPTrees.WHITE_CHERRY).create());
|
|
||||||
treeGenerator.add("large_pink_cherry", 4, (new GeneratorBigTree.Builder()).log(BOPWoods.CHERRY).leaves(BOPTrees.PINK_CHERRY).create());
|
|
||||||
treeGenerator.add("large_white_cherry", 3, (new GeneratorBigTree.Builder()).log(BOPWoods.CHERRY).leaves(BOPTrees.WHITE_CHERRY).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("flax", GeneratorStage.FLOWERS,(new GeneratorDoubleFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPDoublePlant.DoublePlantType.FLAX).generationAttempts(6).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).create());
|
|
||||||
this.addGenerator("clover_patches", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.4F).generationAttempts(128).with(BOPPlants.CLOVERPATCH).create());
|
|
||||||
this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.4F).with(BOPPlants.SPROUT).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(Blocks.WATERLILY.getDefaultState()).create());
|
|
||||||
this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPLilypad.LilypadType.MEDIUM).create());
|
|
||||||
this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPLilypad.LilypadType.SMALL).create());
|
|
||||||
this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPLilypad.LilypadType.TINY).create());
|
|
||||||
this.addGenerator("flower_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BlockBOPLilypad.LilypadType.FLOWER).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.6F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("topaz", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TOPAZ).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x96EA9B);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0xA3FFAA);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,91 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery.BlockQueryBlock;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorBlobs;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplatter;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplotches;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.monster.EntityPolarBear;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
|
|
||||||
public class BiomeGenColdDesert extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public IBlockState usualTopBlock;
|
|
||||||
public IBlockState alternateTopBlock;
|
|
||||||
|
|
||||||
public BiomeGenColdDesert()
|
|
||||||
{
|
|
||||||
super("cold_desert", new PropsBuilder("Cold Desert").withGuiColour(0xB3AF9B).withTemperature(0.2F).withRainfall(0.0F));
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(5, 10).sidewaysNoise(0.7D);
|
|
||||||
|
|
||||||
this.topBlock = Blocks.GRAVEL.getDefaultState();
|
|
||||||
this.fillerBlock = Blocks.STONE.getDefaultState();
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = Blocks.SNOW.getDefaultState();
|
|
||||||
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.ICE_CAP, 10);
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityPolarBear.class, 1, 1, 2));
|
|
||||||
|
|
||||||
// gravel, stone and boulders
|
|
||||||
IBlockPosQuery surface = new BlockQueryBlock(Blocks.STONE, Blocks.GRAVEL);
|
|
||||||
this.addGenerator("stone_patches", GeneratorStage.SAND, (new GeneratorSplotches.Builder()).amountPerChunk(6).splotchSize(24).placeOn(surface).replace(surface).with(Blocks.STONE.getDefaultState()).scatterYMethod(ScatterYMethod.AT_SURFACE).create());
|
|
||||||
this.addGenerator("boulders", GeneratorStage.SAND_PASS2, (new GeneratorBlobs.Builder()).amountPerChunk(0.2F).placeOn(surface).with(Blocks.COBBLESTONE.getDefaultState()).minRadius(1.0F).maxRadius(3.0F).numBalls(4).scatterYMethod(ScatterYMethod.AT_SURFACE).create());
|
|
||||||
this.addGenerator("hard_ice_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(1.0F).replace(surface).with(BOPBlocks.hard_ice.getDefaultState()).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("tanzanite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TANZANITE).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
super.configure(conf);
|
|
||||||
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = conf.getBlockState("alternateTopBlock", this.alternateTopBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
|
|
||||||
{
|
|
||||||
this.topBlock = (noise + rand.nextDouble() * 3.0D > 1.8D) ? this.alternateTopBlock : this.usualTopBlock;
|
|
||||||
super.genTerrainBlocks(world, rand, primer, x, z, noise);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,102 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTaigaTree;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityRabbit;
|
|
||||||
import net.minecraft.entity.passive.EntityWolf;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenConiferousForest extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenConiferousForest()
|
|
||||||
{
|
|
||||||
super("coniferous_forest", new PropsBuilder("Coniferous Forest").withGuiColour(0x528F60).withTemperature(0.45F).withRainfall(0.5F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(68).heightVariation(10, 20);
|
|
||||||
|
|
||||||
this.canGenerateVillages = true;
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.BOREAL, 10);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.LOAMY);
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 8, 4, 4));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
||||||
|
|
||||||
// gravel
|
|
||||||
this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(4).maxRadius(7).with(Blocks.GRAVEL.getDefaultState()).create());
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(8.0F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("fir", 5, (new GeneratorTaigaTree.Builder()).log(BOPWoods.FIR).leaves(BOPTrees.FIR).minHeight(5).maxHeight(28).create());
|
|
||||||
treeGenerator.add("mega_fir", 3, (new GeneratorTaigaTree.Builder()).log(BOPWoods.FIR).leaves(BOPTrees.FIR).minHeight(20).maxHeight(40).trunkWidth(2).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.7F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).generationAttempts(64).create());
|
|
||||||
this.addGenerator("flax", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPDoublePlant.DoublePlantType.FLAX).create());
|
|
||||||
this.addGenerator("poison_ivy", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BOPPlants.POISONIVY).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("flat_mushroom", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.FLAT_MUSHROOM).create());
|
|
||||||
this.addGenerator("toadstools", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.TOADSTOOL).create());
|
|
||||||
this.addGenerator("blue_milk_caps", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.BLUE_MILK_CAP).create());
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.8F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.3F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("bluebells", 1, (new GeneratorFlora.Builder().with(BOPFlowers.BLUEBELLS)).generationAttempts(128).create());
|
|
||||||
flowerGenerator.add("oxeye_daisy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.7F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("tallgrass", 4, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).generationAttempts(128).create());
|
|
||||||
grassGenerator.add("shortgrass", 3, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 3, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("fern", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.FERN).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("amber", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.AMBER).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.BOPGems;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.util.biome.BiomeUtils;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import net.minecraft.init.Biomes;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class BiomeGenCoralReef extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenCoralReef()
|
|
||||||
{
|
|
||||||
super("coral_reef", new PropsBuilder("Coral Reef").withGuiColour(18285));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(45).heightVariation(5, 10);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = BiomeUtils.getLocForBiome(Biomes.OCEAN);
|
|
||||||
|
|
||||||
clearWeights();
|
|
||||||
|
|
||||||
// coral
|
|
||||||
this.addGenerator("pink_coral", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(15.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.PINK)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("orange_coral", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(15.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ORANGE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("blue_coral", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(15.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.BLUE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("glowing_coral", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(15.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.GLOWING)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(3.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("sapphire", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.SAPPHIRE).create());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplatter;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplotches;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class BiomeGenCrag extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenCrag()
|
|
||||||
{
|
|
||||||
super("crag", new PropsBuilder("Crag").withGuiColour(5209457).withTemperature(0.5F).withRainfall(0.5F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(100).heightVariation(80, 200).minHeight(40).sidewaysNoise(0.7F);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COLD_SWAMP, 2);
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
|
|
||||||
this.topBlock = Blocks.GRAVEL.getDefaultState();
|
|
||||||
this.fillerBlock = Blocks.STONE.getDefaultState();
|
|
||||||
|
|
||||||
// gravel, cobblestone, overgrown stone
|
|
||||||
IBlockPosQuery surface = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create();
|
|
||||||
this.addGenerator("overgrown_stone_patches", GeneratorStage.SAND, (new GeneratorSplotches.Builder()).amountPerChunk(24).splotchSize(16).placeOn(surface).replace(surface).with(BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.OVERGROWN_STONE)).scatterYMethod(ScatterYMethod.AT_SURFACE).create());
|
|
||||||
this.addGenerator("cobblestone_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(4.0F).replace(surface).with(Blocks.COBBLESTONE.getDefaultState()).create());
|
|
||||||
this.addGenerator("stone_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(4.0F).replace(surface).with(Blocks.STONE.getDefaultState()).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(4.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("tallgrass", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).generationAttempts(128).create());
|
|
||||||
grassGenerator.add("shortgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).generationAttempts(128).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("emeralds", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(Blocks.EMERALD_ORE.getDefaultState()).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,96 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTaigaTree;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class BiomeGenDeadForest extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenDeadForest()
|
|
||||||
{
|
|
||||||
super("dead_forest", new PropsBuilder("Dead Forest").withGuiColour(0xBCA165).withTemperature(0.3F).withRainfall(0.3F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(68).heightVariation(8, 25);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.LOAMY);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.BOREAL, 3);
|
|
||||||
|
|
||||||
// gravel
|
|
||||||
this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(4).maxRadius(7).with(Blocks.GRAVEL.getDefaultState()).create());
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(2.5F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("spruce", 3, (new GeneratorTaigaTree.Builder()).minHeight(6).maxHeight(16).create()); // TODO: implement pine cones
|
|
||||||
treeGenerator.add("dying_tree", 5, (new GeneratorBigTree.Builder()).minHeight(5).maxHeight(12).foliageHeight(2).leaves(BOPTrees.DEAD).create());
|
|
||||||
treeGenerator.add("oak", 3, (new GeneratorBasicTree.Builder()).leaves(BOPTrees.DEAD).create());
|
|
||||||
treeGenerator.add("dead_tree", 1, (new GeneratorBigTree.Builder()).minHeight(5).maxHeight(12).foliageHeight(0).foliageDensity(0.5D).log(BOPWoods.DEAD).leaves(Blocks.AIR.getDefaultState()).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("thorns", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BOPPlants.THORN).create());
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.8F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(3.5F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).generationAttempts(64).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 4, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 3, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("dead_bushes", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.DEAD_BUSH).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("tanzanite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TANZANITE).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0xBCA165);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0xBCA165);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,119 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPPlant;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplotches;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenDeadSwamp extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenDeadSwamp()
|
|
||||||
{
|
|
||||||
super("dead_swamp", new PropsBuilder("Dead Swamp").withGuiColour(0x8BAF48).withTemperature(0.6F).withRainfall(0.9F).withWaterColor(0xA2AD51));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(63).heightVariation(6, 3);
|
|
||||||
|
|
||||||
//this.skyColor = 0x627268;
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.LOAMY);
|
|
||||||
this.seaFloorBlock = BOPBlocks.mud.getDefaultState();
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COLD_SWAMP, 3);
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
|
|
||||||
// mud
|
|
||||||
this.addGenerator("mud", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(8).maxRadius(7).with(BOPBlocks.mud.getDefaultState()).create());
|
|
||||||
this.addGenerator("mud_patches", GeneratorStage.SAND_PASS2, (new GeneratorSplotches.Builder()).amountPerChunk(1).splotchSize(12).replace(this.topBlock).with(BOPBlocks.mud.getDefaultState()).scatterYMethod(ScatterYMethod.AT_SURFACE).create());
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(0.6F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("dying_tree", 3, (new GeneratorBigTree.Builder()).minHeight(5).maxHeight(12).foliageHeight(1).log(BOPWoods.DEAD).leaves(BOPTrees.DEAD).create());
|
|
||||||
treeGenerator.add("dead_tree", 1, (new GeneratorBigTree.Builder()).minHeight(5).maxHeight(12).foliageHeight(0).foliageDensity(0.5D).log(BOPWoods.DEAD).leaves(Blocks.AIR.getDefaultState()).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.KORU).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("river_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(0.3F).generationAttempts(24).placeOn(BlockQueries.litFertileWaterside).with(BlockBOPPlant.paging.getVariantState(BOPPlants.RIVERCANE)).minHeight(1).maxHeight(3).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).generationAttempts(32).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.4F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 4, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x66704C);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x66704C);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,193 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.config.IBOPWorldSettings;
|
|
||||||
import biomesoplenty.api.config.IBOPWorldSettings.GeneratorType;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.block.BlockBOPPlant;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorBigMushroom;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorMixedLily;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower.EnumFlowerType;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
|
|
||||||
// This class is not intended to be used in the game
|
|
||||||
// It just contains one of every common generator, so it can be used as a template when creating new biomes - just delete lines you don't want and adjust weightings
|
|
||||||
public class BiomeGenDummyTemplate extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenDummyTemplate()
|
|
||||||
{
|
|
||||||
super(null, null);
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(6, 21).octaves(1, 1, 1, 1, 1, 1);
|
|
||||||
|
|
||||||
this.skyColor = 0xFFFFFF;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COOL_TEMPERATE, 10);
|
|
||||||
|
|
||||||
// gravel
|
|
||||||
this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(4).maxRadius(7).with(Blocks.GRAVEL.getDefaultState()).create());
|
|
||||||
|
|
||||||
// mud
|
|
||||||
this.addGenerator("mud", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(3).maxRadius(7).with(BOPBlocks.mud.getDefaultState()).create());
|
|
||||||
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(9);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
// TODO: standard trees here? Is there such a thing as standard trees?
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(2.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("deadgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DEADGRASS).create());
|
|
||||||
grassGenerator.add("desertgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DESERTGRASS).create());
|
|
||||||
grassGenerator.add("dunegrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DUNEGRASS).create());
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("ferns", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.FERN).create());
|
|
||||||
grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("doublegrass", 1, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.GRASS).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("berry_bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.BERRYBUSH).create());
|
|
||||||
this.addGenerator("bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.BUSH).create());
|
|
||||||
this.addGenerator("cattails", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.CATTAIL).create());
|
|
||||||
this.addGenerator("clover_patches", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.CLOVERPATCH).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
this.addGenerator("desert_sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.DESERTSPROUTS).create());
|
|
||||||
this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.KORU).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.LEAFPILE).create());
|
|
||||||
this.addGenerator("poison_ivy", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.POISONIVY).create());
|
|
||||||
this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("spectral_ferns", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.SPECTRALFERN).create());
|
|
||||||
this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.SPROUT).create());
|
|
||||||
this.addGenerator("thorns", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.THORN).create());
|
|
||||||
this.addGenerator("tiny_cacti", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.TINYCACTUS).create());
|
|
||||||
this.addGenerator("wild_rice", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.WILDRICE).create());
|
|
||||||
this.addGenerator("dead_bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockTallGrass.EnumType.DEAD_BUSH).create());
|
|
||||||
this.addGenerator("eyebulbs", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPDoublePlant.DoublePlantType.EYEBULB).create());
|
|
||||||
this.addGenerator("flax", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPDoublePlant.DoublePlantType.FLAX).create());
|
|
||||||
this.addGenerator("tall_cattails", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPDoublePlant.DoublePlantType.TALL_CATTAIL).create());
|
|
||||||
this.addGenerator("tall_ferns", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.5F).with(BlockDoublePlant.EnumPlantType.FERN).create());
|
|
||||||
this.addGenerator("river_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(0.5F).placeOn(BlockQueries.litFertileWaterside).with(BlockBOPPlant.paging.getVariantState(BOPPlants.RIVERCANE)).minHeight(1).maxHeight(3).create());
|
|
||||||
this.addGenerator("sugar_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(0.5F).placeOn(BlockQueries.litFertileWaterside).with(Blocks.REEDS.getDefaultState()).minHeight(1).maxHeight(3).create());
|
|
||||||
// TODO root
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
this.addGenerator("mixed_lily", GeneratorStage.LILYPAD, (new GeneratorMixedLily.Builder()).amountPerChunk(0.5F).create());
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(1.0F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.GRASS, flowerGenerator);
|
|
||||||
flowerGenerator.add("alliums", 1, (new GeneratorFlora.Builder().with(EnumFlowerType.ALLIUM).create()));
|
|
||||||
flowerGenerator.add("blue_orchids", 1, (new GeneratorFlora.Builder().with(EnumFlowerType.BLUE_ORCHID).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("houstonias", 1, (new GeneratorFlora.Builder().with(EnumFlowerType.HOUSTONIA).create()));
|
|
||||||
flowerGenerator.add("orange_tulips", 1, (new GeneratorFlora.Builder().with(EnumFlowerType.ORANGE_TULIP).create()));
|
|
||||||
flowerGenerator.add("oxeye_daisies", 1, (new GeneratorFlora.Builder().with(EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
flowerGenerator.add("pink_tulips", 1, (new GeneratorFlora.Builder().with(EnumFlowerType.PINK_TULIP).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(EnumFlowerType.POPPY).create()));
|
|
||||||
flowerGenerator.add("red_tulips", 1, (new GeneratorFlora.Builder().with(EnumFlowerType.RED_TULIP).create()));
|
|
||||||
flowerGenerator.add("white_tulips", 1, (new GeneratorFlora.Builder().with(EnumFlowerType.WHITE_TULIP).create()));
|
|
||||||
flowerGenerator.add("blue_hydrangeas", 1, (new GeneratorFlora.Builder().with(BOPFlowers.BLUE_HYDRANGEA).create()));
|
|
||||||
flowerGenerator.add("bluebells", 1, (new GeneratorFlora.Builder().with(BOPFlowers.BLUEBELLS).create()));
|
|
||||||
flowerGenerator.add("bromeliads", 1, (new GeneratorFlora.Builder().with(BOPFlowers.BROMELIAD).create()));
|
|
||||||
flowerGenerator.add("burning_blossoms", 1, (new GeneratorFlora.Builder().with(BOPFlowers.BURNING_BLOSSOM).create()));
|
|
||||||
flowerGenerator.add("clover", 1, (new GeneratorFlora.Builder().with(BOPFlowers.CLOVER).create()));
|
|
||||||
flowerGenerator.add("wilted_lily", 1, (new GeneratorFlora.Builder().with(BOPFlowers.WILTED_LILY).create()));
|
|
||||||
flowerGenerator.add("deathbloom", 1, (new GeneratorFlora.Builder().with(BOPFlowers.DEATHBLOOM).create()));
|
|
||||||
flowerGenerator.add("enterlotus", 1, (new GeneratorFlora.Builder().with(BOPFlowers.ENDERLOTUS).create()));
|
|
||||||
flowerGenerator.add("glowflower", 1, (new GeneratorFlora.Builder().with(BOPFlowers.GLOWFLOWER).create()));
|
|
||||||
flowerGenerator.add("goldenrods", 1, (new GeneratorFlora.Builder().with(BOPFlowers.GOLDENROD).create()));
|
|
||||||
flowerGenerator.add("icy_irises", 1, (new GeneratorFlora.Builder().with(BOPFlowers.ICY_IRIS).create()));
|
|
||||||
flowerGenerator.add("lavender", 1, (new GeneratorFlora.Builder().with(BOPFlowers.LAVENDER).create()));
|
|
||||||
flowerGenerator.add("lily_of_the_valley", 1, (new GeneratorFlora.Builder().with(BOPFlowers.LILY_OF_THE_VALLEY).create()));
|
|
||||||
flowerGenerator.add("miners_delight", 1, (new GeneratorFlora.Builder().with(BOPFlowers.MINERS_DELIGHT).create()));
|
|
||||||
flowerGenerator.add("orange_cosmos", 1, (new GeneratorFlora.Builder().with(BOPFlowers.ORANGE_COSMOS).create()));
|
|
||||||
flowerGenerator.add("pink_daffodil", 1, (new GeneratorFlora.Builder().with(BOPFlowers.PINK_DAFFODIL).create()));
|
|
||||||
flowerGenerator.add("hibiscus", 1, (new GeneratorFlora.Builder().with(BOPFlowers.PINK_HIBISCUS).create()));
|
|
||||||
flowerGenerator.add("roses", 1, (new GeneratorFlora.Builder().with(BOPFlowers.ROSE).create()));
|
|
||||||
flowerGenerator.add("swampflower", 1, (new GeneratorFlora.Builder().with(BOPFlowers.SWAMPFLOWER).create()));
|
|
||||||
flowerGenerator.add("violet", 1, (new GeneratorFlora.Builder().with(BOPFlowers.VIOLET).create()));
|
|
||||||
flowerGenerator.add("white_anemones", 1, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE).create()));
|
|
||||||
flowerGenerator.add("wildflowers", 1, (new GeneratorFlora.Builder().with(BOPFlowers.WILDFLOWER).create()));
|
|
||||||
flowerGenerator.add("paeonias", 1, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.PAEONIA).create());
|
|
||||||
flowerGenerator.add("tall_roses", 1, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.ROSE).create());
|
|
||||||
flowerGenerator.add("sunflowers", 1, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.SUNFLOWER).create());
|
|
||||||
flowerGenerator.add("syringas", 1, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.SYRINGA).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("blue_milk_caps", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPMushroom.MushroomType.BLUE_MILK_CAP).create());
|
|
||||||
this.addGenerator("flat_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPMushroom.MushroomType.FLAT_MUSHROOM).create());
|
|
||||||
this.addGenerator("glowshrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPMushroom.MushroomType.GLOWSHROOM).create());
|
|
||||||
this.addGenerator("portobellos", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPMushroom.MushroomType.PORTOBELLO).create());
|
|
||||||
this.addGenerator("shadow_shrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPMushroom.MushroomType.SHADOW_SHROOM).create());
|
|
||||||
this.addGenerator("toadstools", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPMushroom.MushroomType.TOADSTOOL).create());
|
|
||||||
|
|
||||||
// big mushrooms
|
|
||||||
GeneratorWeighted mushroomGenerator = new GeneratorWeighted(0.5F);
|
|
||||||
this.addGenerator("big_mushrooms", GeneratorStage.BIG_SHROOM, mushroomGenerator);
|
|
||||||
mushroomGenerator.add("brown_mushroom", 1, (new GeneratorBigMushroom.Builder()).mushroomType(GeneratorBigMushroom.BigMushroomType.BROWN).create());
|
|
||||||
mushroomGenerator.add("red_mushroom", 1, (new GeneratorBigMushroom.Builder()).mushroomType(GeneratorBigMushroom.BigMushroomType.RED).create());
|
|
||||||
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("amber", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.AMBER).create());
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void applySettings(IBOPWorldSettings settings)
|
|
||||||
{
|
|
||||||
if (!settings.isEnabled(GeneratorType.GEMS)) {this.removeGenerator("amber");}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0xFFFFFF);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0xFFFFFF);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,84 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLilypad;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBulbTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBush;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityOcelot;
|
|
||||||
import net.minecraft.entity.passive.EntityParrot;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class BiomeGenEucalyptusForest extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenEucalyptusForest()
|
|
||||||
{
|
|
||||||
super("eucalyptus_forest", new PropsBuilder("Eucalyptus Forest").withGuiColour(0x9DCC70).withTemperature(0.95F).withRainfall(0.9F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(10, 20);
|
|
||||||
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.TROPICAL, 5);
|
|
||||||
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityParrot.class, 40, 1, 2));
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(10);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("oak_bush", 8, (new GeneratorBush.Builder()).maxHeight(2).create());
|
|
||||||
treeGenerator.add("tall_eucalyptus", 1, (new GeneratorBulbTree.Builder()).minHeight(15).maxHeight(30).log(BOPWoods.EUCALYPTUS).leaves(BOPTrees.EUCALYPTUS).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(6);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 4, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("fern", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.FERN).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.5F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.SPROUT).create());
|
|
||||||
this.addGenerator("bushes", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.BUSH).create());
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("rafflesia", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.RAFFLESIA).create());
|
|
||||||
this.addGenerator("melons", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.015625F).placeOn(this.topBlock).with(Blocks.MELON_BLOCK.getDefaultState()).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(Blocks.WATERLILY.getDefaultState()).create());
|
|
||||||
this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BlockBOPLilypad.LilypadType.MEDIUM).create());
|
|
||||||
this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.SMALL).create());
|
|
||||||
this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.TINY).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("topaz", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TOPAZ).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,138 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLilypad;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.block.BlockBOPPlant;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTaigaTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenFen extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenFen()
|
|
||||||
{
|
|
||||||
super("fen", new PropsBuilder("Fen").withGuiColour(0xBAC481).withTemperature(0.4F).withRainfall(0.4F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(63).heightVariation(8, 6).octaves(1, 4, 3, 1, 1, 0);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.LOAMY);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COLD_SWAMP, 7);
|
|
||||||
|
|
||||||
// mud
|
|
||||||
this.addGenerator("mud", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(1).maxRadius(7).with(BOPBlocks.mud.getDefaultState()).create());
|
|
||||||
|
|
||||||
// trees and logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(6);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("oak_tree", 1, (new GeneratorTwigletTree.Builder()).leaves(BOPTrees.DEAD).minHeight(5).maxHeight(10).leafChance(0.3F, 0.9F).create());
|
|
||||||
treeGenerator.add("dark_oak_tree", 7, (new GeneratorBigTree.Builder()).log(BlockPlanks.EnumType.DARK_OAK).leaves(BlockPlanks.EnumType.DARK_OAK).foliageHeight(2).maxHeight(12).create());
|
|
||||||
treeGenerator.add("birch_twiglet", 1, (new GeneratorTwigletTree.Builder()).log(BlockPlanks.EnumType.BIRCH).leaves(BlockPlanks.EnumType.BIRCH).minHeight(2).maxHeight(4).leafChance(0.3F, 0.9F).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(5.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 4, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("doublegrass", 3, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.GRASS).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("cattail", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.25F).with(BOPPlants.CATTAIL).create());
|
|
||||||
this.addGenerator("double_cattail", GeneratorStage.FLOWERS,(new GeneratorDoubleFlora.Builder()).amountPerChunk(0.25F).with(BlockBOPDoublePlant.DoublePlantType.TALL_CATTAIL).create());
|
|
||||||
this.addGenerator("river_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(0.1F).generationAttempts(24).placeOn(BlockQueries.litFertileWaterside).with(BlockBOPPlant.paging.getVariantState(BOPPlants.RIVERCANE)).minHeight(1).maxHeight(3).create());
|
|
||||||
this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.KORU).create());
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.5F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).generationAttempts(64).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(15.0F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.25F).with(Blocks.WATERLILY.getDefaultState()).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("flat_mushroom", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.FLAT_MUSHROOM).create());
|
|
||||||
this.addGenerator("toadstools", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.TOADSTOOL).create());
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.4F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.4F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0xC1BE7F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0xABBF65);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,76 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorProfileTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
|
||||||
import net.minecraft.block.BlockFlower.EnumFlowerType;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class BiomeGenFlowerField extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenFlowerField()
|
|
||||||
{
|
|
||||||
super("flower_field", new PropsBuilder("Flower Field").withGuiColour(4044093).withTemperature(0.7F).withRainfall(0.7F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(5, 5).octaves(0, 1, 2, 2, 1, 0);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.WARM_TEMPERATE, 2);
|
|
||||||
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(3.0F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("small_bush", 1, (new GeneratorFlora.Builder()).placeOn(this.topBlock).replace(Material.AIR).withNonDecayingLeaf(BlockPlanks.EnumType.OAK).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(17.5F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("pink_tulip", 6, (new GeneratorFlora.Builder().with(EnumFlowerType.PINK_TULIP).create()));
|
|
||||||
flowerGenerator.add("white_tulip", 9, (new GeneratorFlora.Builder().with(EnumFlowerType.WHITE_TULIP).create()));
|
|
||||||
flowerGenerator.add("orange_tulip", 11, (new GeneratorFlora.Builder().with(EnumFlowerType.ORANGE_TULIP).create()));
|
|
||||||
flowerGenerator.add("red_tulip", 14, (new GeneratorFlora.Builder().with(EnumFlowerType.RED_TULIP).create()));
|
|
||||||
flowerGenerator.add("oxeye_daisy", 3, (new GeneratorFlora.Builder().with(EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
flowerGenerator.add("dandelion", 3, (new GeneratorFlora.Builder().with(EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 3, (new GeneratorFlora.Builder().with(EnumFlowerType.POPPY).create()));
|
|
||||||
flowerGenerator.add("white_anemone", 2, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE)).create());
|
|
||||||
flowerGenerator.add("houstonia", 2, (new GeneratorFlora.Builder().with(EnumFlowerType.HOUSTONIA).create()));
|
|
||||||
flowerGenerator.add("rose", 1, (new GeneratorDoubleFlora.Builder()).amountPerChunk(1).with(BlockDoublePlant.EnumPlantType.ROSE).create());
|
|
||||||
flowerGenerator.add("syringa", 1, (new GeneratorDoubleFlora.Builder()).amountPerChunk(1).with(BlockDoublePlant.EnumPlantType.SYRINGA).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(20.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("peridot", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.PERIDOT).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,104 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorBigFlower;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplatter;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBush;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockFlower.EnumFlowerType;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class BiomeGenFlowerIsland extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenFlowerIsland()
|
|
||||||
{
|
|
||||||
super("flower_island", new PropsBuilder("Flower Island").withGuiColour(0x74D374).withTemperature(0.8F).withRainfall(0.8F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(70).heightVariation(10, 15).octaves(0, 0, 1, 1, 2, 2);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.DAISY);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
|
|
||||||
clearWeights();
|
|
||||||
|
|
||||||
this.spawnableMonsterList.clear();
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
|
|
||||||
// regular grass
|
|
||||||
IBlockPosQuery emptyGrass = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create();
|
|
||||||
this.addGenerator("grass_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(6.0F).replace(emptyGrass).with(Blocks.GRASS.getDefaultState()).create());
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(1);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("red_big_flowers", 1, (new GeneratorBigFlower.Builder()).flowerType(GeneratorBigFlower.BigFlowerType.RED).create());
|
|
||||||
treeGenerator.add("yellow_big_flowers", 1, (new GeneratorBigFlower.Builder()).flowerType(GeneratorBigFlower.BigFlowerType.YELLOW).create());
|
|
||||||
treeGenerator.add("oak_bush", 2, (new GeneratorBush.Builder()).maxHeight(2).altLeaves(BOPTrees.FLOWERING).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(0.75F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("tallgrass", 4, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("clover_patches", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).generationAttempts(128).with(BOPPlants.CLOVERPATCH).create());
|
|
||||||
this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.SPROUT).create());
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(4.0F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("dandelion", 3, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 5, (new GeneratorFlora.Builder().with(EnumFlowerType.POPPY).create()));
|
|
||||||
flowerGenerator.add("white_anemones", 4, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE).create()));
|
|
||||||
flowerGenerator.add("blue_hydrangeas", 2, (new GeneratorFlora.Builder().with(BOPFlowers.BLUE_HYDRANGEA).create()));
|
|
||||||
flowerGenerator.add("sunflowers", 1, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.SUNFLOWER).create());
|
|
||||||
flowerGenerator.add("oxeye_daisy", 2, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
flowerGenerator.add("rose", 2, (new GeneratorDoubleFlora.Builder().with(BlockDoublePlant.EnumPlantType.ROSE).create()));
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("topaz", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TOPAZ).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x74D374);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x66E266);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.BOPGems;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import net.minecraft.entity.monster.EntityPolarBear;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenGlacier extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenGlacier()
|
|
||||||
{
|
|
||||||
super("glacier", new PropsBuilder("Glacier").withTemperature(-0.5F).withRainfall(0.2F).withGuiColour(11582425));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(88).heightVariation(8, 10).octaves(0, 1, 1, 3, 1, 0);
|
|
||||||
|
|
||||||
this.topBlock = Blocks.ICE.getDefaultState();
|
|
||||||
this.fillerBlock = BOPBlocks.hard_ice.getDefaultState();
|
|
||||||
|
|
||||||
this.avgDirtDepth = 16;
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityPolarBear.class, 1, 1, 2));
|
|
||||||
|
|
||||||
clearWeights();
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("tanzanite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TANZANITE).create());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,101 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.block.BlockBOPPlant;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityDonkey;
|
|
||||||
import net.minecraft.entity.passive.EntityHorse;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenGrassland extends BOPOverworldBiome {
|
|
||||||
|
|
||||||
public BiomeGenGrassland() {
|
|
||||||
|
|
||||||
super("grassland", new PropsBuilder("Grassland").withGuiColour(0x7FDB7D).withTemperature(0.6F).withRainfall(0.7F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(6, 25).octaves(0, 1, 2, 2, 1, 0).sidewaysNoise(0.1D);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COOL_TEMPERATE, 7);
|
|
||||||
this.addWeight(BOPClimates.WET_TEMPERATE, 3);
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.canGenerateVillages = true;
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityDonkey.class, 1, 1, 1));
|
|
||||||
|
|
||||||
// lakes
|
|
||||||
this.addGenerator("lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).waterLakeForBiome(this).amountPerChunk(0.2F).create());
|
|
||||||
|
|
||||||
// sand and gravel
|
|
||||||
this.addGenerator("sand", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(3).maxRadius(7).with(Blocks.SAND.getDefaultState()).create());
|
|
||||||
this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(4).maxRadius(7).with(Blocks.GRAVEL.getDefaultState()).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("river_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(1.0F).generationAttempts(24).placeOn(BlockQueries.litFertileWaterside).with(BlockBOPPlant.paging.getVariantState(BOPPlants.RIVERCANE)).minHeight(1).maxHeight(3).create());
|
|
||||||
this.addGenerator("sugar_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(4.0F).generationAttempts(24).placeOn(BlockQueries.litFertileWaterside).with(Blocks.REEDS.getDefaultState()).minHeight(1).maxHeight(3).create());
|
|
||||||
this.addGenerator("flax", GeneratorStage.FLOWERS,(new GeneratorDoubleFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPDoublePlant.DoublePlantType.FLAX).generationAttempts(6).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("portobellos", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.PORTOBELLO).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(0.6F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 4, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("peridot", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.PERIDOT).create());
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x7FDB7D);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x7FDB7D);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class BiomeGenGravelBeach extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenGravelBeach()
|
|
||||||
{
|
|
||||||
super("gravel_beach", new PropsBuilder("Gravel Beach").withGuiColour(0x908884).withTemperature(0.6F).withRainfall(0.5F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(3, 4);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
|
|
||||||
this.decorator.deadBushPerChunk = 0;
|
|
||||||
this.decorator.reedsPerChunk = 0;
|
|
||||||
this.decorator.cactiPerChunk = 0;
|
|
||||||
|
|
||||||
clearWeights();
|
|
||||||
|
|
||||||
this.topBlock = Blocks.GRAVEL.getDefaultState();
|
|
||||||
this.fillerBlock = Blocks.GRAVEL.getDefaultState();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,95 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBush;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorProfileTree;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class BiomeGenGrove extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenGrove()
|
|
||||||
{
|
|
||||||
super("grove", new PropsBuilder("Grove").withGuiColour(0x517F51).withTemperature(0.6F).withRainfall(0.8F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(66).heightVariation(8, 20).octaves(0, 1, 2, 2, 1, 0).sidewaysNoise(0.1D);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COOL_TEMPERATE, 7);
|
|
||||||
|
|
||||||
this.canGenerateVillages = true;
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SPROUT).create());
|
|
||||||
this.addGenerator("berry_bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.BERRYBUSH).create());
|
|
||||||
this.addGenerator("bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.BUSH).create());
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("clover_patches", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.6F).generationAttempts(128).with(BOPPlants.CLOVERPATCH).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).create());
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(3);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("dark_poplar", 1, (new GeneratorProfileTree.Builder()).minHeight(6).maxHeight(14).log(BlockPlanks.EnumType.DARK_OAK).leaves(BlockPlanks.EnumType.DARK_OAK).profile(GeneratorProfileTree.TreeProfile.POPLAR).create());
|
|
||||||
treeGenerator.add("poplar", 1, (new GeneratorProfileTree.Builder()).minHeight(8).maxHeight(18).log(BlockPlanks.EnumType.BIRCH).leaves(BlockPlanks.EnumType.BIRCH).profile(GeneratorProfileTree.TreeProfile.POPLAR).create());
|
|
||||||
treeGenerator.add("bush", 1, (new GeneratorBush.Builder()).maxHeight(2).altLeaves(BOPTrees.FLOWERING).create());
|
|
||||||
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(2.0F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("clover", 4, (new GeneratorFlora.Builder().with(BOPFlowers.CLOVER).create()));
|
|
||||||
flowerGenerator.add("white_anemones", 2, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE).create()));
|
|
||||||
flowerGenerator.add("paeonias", 1, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.PAEONIA).create());
|
|
||||||
flowerGenerator.add("oxeye_daisy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.3F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("amber", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.AMBER).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x639966);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x6CB070);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class BiomeGenHighland extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenHighland()
|
|
||||||
{
|
|
||||||
super("highland", new PropsBuilder("Highland").withGuiColour(0x7CAD66).withTemperature(0.6F).withRainfall(0.8F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(100).heightVariation(35, 35).octaves(0, 1, 1, 3, 1, 0);
|
|
||||||
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COOL_TEMPERATE, 7);
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(10);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("doublegrass", 4, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.GRASS).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("emerald", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(Blocks.EMERALD_ORE.getDefaultState()).create());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.util.biome.BiomeUtils;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import net.minecraft.init.Biomes;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
|
|
||||||
public class BiomeGenKelpForest extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenKelpForest()
|
|
||||||
{
|
|
||||||
super("kelp_forest", new PropsBuilder("Kelp Forest").withGuiColour(27468));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(40).heightVariation(5, 5);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = BiomeUtils.getLocForBiome(Biomes.OCEAN);
|
|
||||||
|
|
||||||
clearWeights();
|
|
||||||
|
|
||||||
// algae
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(3.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
|
|
||||||
// kelp
|
|
||||||
this.addGenerator("kelp", GeneratorStage.LILYPAD, (new GeneratorColumns.Builder()).amountPerChunk(5.0F).replace(BlockQueries.waterCovered).placeOn(BlockQueries.groundBlocks).with(BOPBlocks.seaweed.getDefaultState()).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("kelp_tall", GeneratorStage.LILYPAD, (new GeneratorColumns.Builder()).amountPerChunk(6.0F).replace(BlockQueries.waterCovered).placeOn(BlockQueries.groundBlocks).with(BOPBlocks.seaweed.getDefaultState()).minHeight(6).maxHeight(12).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("sapphire", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.SAPPHIRE).create());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,132 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLilypad;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTaigaTree;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenLandOfLakes extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
// TODO: fog color / closeness? what's that?
|
|
||||||
// TODO: should there be foliage colors / water colors?
|
|
||||||
|
|
||||||
public BiomeGenLandOfLakes()
|
|
||||||
{
|
|
||||||
super("land_of_lakes", new PropsBuilder("Land of Lakes").withGuiColour(0x66A06E).withTemperature(0.5F).withRainfall(0.9F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(63).heightVariation(10, 10).octaves(5, 5, 0, 0, 1, 1).sidewaysNoise(0.1D);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.LOAMY);
|
|
||||||
this.seaFloorBlock = BOPBlocks.mud.getDefaultState();
|
|
||||||
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COLD_SWAMP, 3);
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
// gravel
|
|
||||||
this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(4).maxRadius(7).with(Blocks.GRAVEL.getDefaultState()).create());
|
|
||||||
|
|
||||||
// mud
|
|
||||||
this.addGenerator("mud", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(8).maxRadius(7).with(BOPBlocks.mud.getDefaultState()).create());
|
|
||||||
|
|
||||||
// lakes
|
|
||||||
this.addGenerator("lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(1.0F).waterLakeForBiome(this).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(40);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("oak", 5, (new GeneratorBasicTree.Builder()).create());
|
|
||||||
treeGenerator.add("birch", 1, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.BIRCH).leaves(BlockPlanks.EnumType.BIRCH).create());
|
|
||||||
treeGenerator.add("spruce", 3, (new GeneratorTaigaTree.Builder()).maxHeight(13).create()); // TODO: implement pine cones
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.0F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).generationAttempts(64).create());
|
|
||||||
this.addGenerator("wild_rice", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.0F).with(BOPPlants.WILDRICE).generationAttempts(64).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(Blocks.WATERLILY.getDefaultState()).create());
|
|
||||||
this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPLilypad.LilypadType.MEDIUM).create());
|
|
||||||
this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPLilypad.LilypadType.SMALL).create());
|
|
||||||
this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPLilypad.LilypadType.TINY).create());
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(1.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(1.0F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(10.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 5, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 5, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
|
|
||||||
return getModdedBiomeGrassColor(noise < -0.1D ? 13414508 : 13419628);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D);
|
|
||||||
return getModdedBiomeFoliageColor(noise < -0.1D ? 12766316 : 10730594);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,81 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLeaves;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import net.minecraft.block.BlockOldLeaf;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class BiomeGenLavenderFields extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenLavenderFields()
|
|
||||||
{
|
|
||||||
super("lavender_fields", new PropsBuilder("Lavender Fields").withGuiColour(11035852).withTemperature(0.7F).withRainfall(0.7F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(4, 12);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SILTY);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.MEDITERANEAN, 3);
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
this.addGenerator("lavender", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(50).with(BOPFlowers.LAVENDER).create());
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(1);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("jacaranda", 3, (new GeneratorBasicTree.Builder()).minHeight(4).maxHeight(7).log(BOPWoods.JACARANDA).leaves(BOPTrees.JACARANDA).create());
|
|
||||||
treeGenerator.add("oak", 1, (new GeneratorBigTree.Builder()).altLeaves(BlockBOPLeaves.paging.getVariantState(BOPTrees.FLOWERING).withProperty(BlockOldLeaf.CHECK_DECAY, Boolean.valueOf(false))).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(15);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 3, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("peridot", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.PERIDOT).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(10601325);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(10601325);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,127 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2014-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplatter;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityRabbit;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenLushDesert extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenLushDesert()
|
|
||||||
{
|
|
||||||
super("lush_desert", new PropsBuilder("Lush Desert").withGuiColour(0x8AA92D).withTemperature(1.2F).withRainfall(0.4F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(63).heightVariation(8, 40).octaves(2, 2, 1, 0, 1, 1);
|
|
||||||
|
|
||||||
this.topBlock = Blocks.HARDENED_CLAY.getDefaultState();
|
|
||||||
this.fillerBlock = Blocks.HARDENED_CLAY.getDefaultState();
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = true;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.SAVANNA, 2);
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
||||||
|
|
||||||
// trees
|
|
||||||
IBlockPosQuery suitableTreePosition = BlockQuery.buildAnd().withAltitudeBetween(62, 68).states(this.topBlock).withAirAbove().create();
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(4);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("decaying_tree", 3, (new GeneratorBigTree.Builder()).placeOn(suitableTreePosition).minHeight(5).log(BlockPlanks.EnumType.ACACIA).leaves(BlockPlanks.EnumType.ACACIA).maxHeight(12).foliageHeight(3).create());
|
|
||||||
treeGenerator.add("twiglet", 5, (new GeneratorTwigletTree.Builder()).placeOn(suitableTreePosition).minHeight(2).maxHeight(2).log(BlockPlanks.EnumType.OAK).leaves(BlockPlanks.EnumType.OAK).create());
|
|
||||||
treeGenerator.add("dead_tree", 1, (new GeneratorBigTree.Builder()).placeOn(suitableTreePosition).minHeight(5).maxHeight(12).foliageHeight(0).foliageDensity(0.5D).log(BOPWoods.DEAD).leaves(Blocks.AIR.getDefaultState()).create());
|
|
||||||
|
|
||||||
this.addGenerator("grass_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(4.0F).generationAttempts(128).replace(suitableTreePosition).with(BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SANDY)).create());
|
|
||||||
|
|
||||||
// sand
|
|
||||||
this.addGenerator("sand", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(5).maxRadius(7).replace(Blocks.HARDENED_CLAY.getDefaultState()).with(Blocks.SAND.getDefaultState()).create());
|
|
||||||
|
|
||||||
// oases
|
|
||||||
this.addGenerator("oases", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(10).maxRadius(7).replace(Blocks.HARDENED_CLAY.getDefaultState()).with(BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SANDY)).create());
|
|
||||||
|
|
||||||
// lakes
|
|
||||||
this.addGenerator("lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(1.5F).waterLakeForBiome(this).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("desertgrass", GeneratorStage.GRASS, (new GeneratorGrass.Builder()).amountPerChunk(1.8F).with(BOPPlants.DESERTGRASS).generationAttempts(8).create());
|
|
||||||
this.addGenerator("bromeliad", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder().amountPerChunk(0.2F).with(BOPFlowers.BROMELIAD).generationAttempts(8).create()));
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.75F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).generationAttempts(32).create());
|
|
||||||
this.addGenerator("bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.8F).with(BOPPlants.BUSH).create());
|
|
||||||
this.addGenerator("tiny_cacti", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.TINYCACTUS).create());
|
|
||||||
this.addGenerator("dead_bushes", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.4F).with(Blocks.DEADBUSH.getDefaultState()).create());
|
|
||||||
this.addGenerator("cacti", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(0.2F).generationAttempts(3).placeOn(this.topBlock).with(Blocks.CACTUS.getDefaultState()).minHeight(1).maxHeight(2).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(4.0F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("wildflowers", 4, (new GeneratorFlora.Builder().with(BOPFlowers.WILDFLOWER).create()));
|
|
||||||
flowerGenerator.add("white_anemones", 1, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// grasses (note weighting must be quite high as the grasses will only grow on the splattered grass blocks)
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(12.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 3, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("ruby", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.RUBY).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,137 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLilypad;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.block.BlockBOPPlant;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockFlower.EnumFlowerType;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.BlockOldLeaf;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.monster.EntitySlime;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenLushSwamp extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenLushSwamp()
|
|
||||||
{
|
|
||||||
super("lush_swamp", new PropsBuilder("Lush Swamp").withGuiColour(0x57AE34).withTemperature(0.7F).withRainfall(1.0F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(63).heightVariation(5, 10).octaves(1, 1, 1, 1, 0, 0).sidewaysNoise(0.0F);
|
|
||||||
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.WET_TEMPERATE, 10);
|
|
||||||
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));
|
|
||||||
|
|
||||||
// mud
|
|
||||||
this.addGenerator("mud", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(0.5F).maxRadius(8).with(BOPBlocks.mud.getDefaultState()).create());
|
|
||||||
|
|
||||||
// sand
|
|
||||||
this.addGenerator("sand", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(0.5F).maxRadius(7).with(Blocks.SAND.getDefaultState()).create());
|
|
||||||
|
|
||||||
// lakes
|
|
||||||
this.addGenerator("poison_lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.1F).liquid(BOPBlocks.poison).frozenLiquid((IBlockState)null).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(6);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("swamp", 5, (new GeneratorBasicTree.Builder()).minHeight(8).maxHeight(12).maxLeavesRadius(2).leaves(Blocks.LEAVES.getDefaultState().withProperty(BlockOldLeaf.CHECK_DECAY, Boolean.valueOf(false))).vine(Blocks.VINE.getDefaultState()).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.7F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.25F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("blue_hydrangeas", 2, (new GeneratorFlora.Builder().with(BOPFlowers.BLUE_HYDRANGEA).create()));
|
|
||||||
flowerGenerator.add("swampflower", 2, (new GeneratorFlora.Builder()).with(BOPFlowers.SWAMPFLOWER).create());
|
|
||||||
flowerGenerator.add("blue_orchid", 1, (new GeneratorFlora.Builder().with(EnumFlowerType.BLUE_ORCHID).create()));
|
|
||||||
flowerGenerator.add("houstonia", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.HOUSTONIA).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BOPPlants.KORU).create());
|
|
||||||
this.addGenerator("cattail", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.CATTAIL).create());
|
|
||||||
this.addGenerator("double_cattail", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPDoublePlant.DoublePlantType.TALL_CATTAIL).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).create());
|
|
||||||
this.addGenerator("sugar_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(0.6F).generationAttempts(24).placeOn(BlockQueries.litFertileWaterside).with(Blocks.REEDS.getDefaultState()).minHeight(1).maxHeight(3).create());
|
|
||||||
this.addGenerator("river_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(0.3F).generationAttempts(24).placeOn(BlockQueries.litFertileWaterside).with(BlockBOPPlant.paging.getVariantState(BOPPlants.RIVERCANE)).minHeight(1).maxHeight(3).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(Blocks.WATERLILY.getDefaultState()).create());
|
|
||||||
this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BlockBOPLilypad.LilypadType.MEDIUM).create());
|
|
||||||
this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.SMALL).create());
|
|
||||||
this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.TINY).create());
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(2.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.7F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
this.addGenerator("flower_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.25F).with(BlockBOPLilypad.LilypadType.FLOWER).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("toadstools", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.TOADSTOOL).create());
|
|
||||||
this.addGenerator("blue_milk_caps", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.BLUE_MILK_CAP).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,108 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorMangroveTree;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenMangrove extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenMangrove()
|
|
||||||
{
|
|
||||||
super("mangrove", new PropsBuilder("Mangrove").withTemperature(0.85F).withRainfall(0.3F).withGuiColour(7251289).withWaterColor(0xCDFF51));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(62).heightVariation(8, 2).octaves(0, 1, 2, 2, 1, 0);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.HOT_SWAMP, 7);
|
|
||||||
|
|
||||||
this.seaFloorBlock = BOPBlocks.mud.getDefaultState();
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.mud.getDefaultState();
|
|
||||||
this.fillerBlock = BOPBlocks.mud.getDefaultState();
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
// quicksand
|
|
||||||
this.addGenerator("quicksand", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.2F).liquid(BOPBlocks.sand).frozenLiquid((IBlockState)null).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
IBlockPosQuery emptyMud = BlockQuery.buildAnd().states(this.topBlock).create();
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(5);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("mangrove", 1, (new GeneratorMangroveTree.Builder()).placeOn(emptyMud).log(BOPWoods.MANGROVE).leaves(BOPTrees.MANGROVE).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("sapphire", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.SAPPHIRE).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
|
|
||||||
{
|
|
||||||
double d0 = GRASS_COLOR_NOISE.getValue((double)x * 0.25D, (double)z * 0.25D);
|
|
||||||
|
|
||||||
if (d0 > 0.0D)
|
|
||||||
{
|
|
||||||
int i = x & 15;
|
|
||||||
int j = z & 15;
|
|
||||||
|
|
||||||
for (int k = 255; k >= 0; --k)
|
|
||||||
{
|
|
||||||
if (primer.getBlockState(j, k, i).getMaterial() != Material.AIR)
|
|
||||||
{
|
|
||||||
if (k == 62 && primer.getBlockState(j, k, i).getBlock() != Blocks.WATER)
|
|
||||||
{
|
|
||||||
primer.setBlockState(j, k, i, WATER);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.generateBiomeTerrain(world, rand, primer, x, z, noise);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,81 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTaigaTree;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityRabbit;
|
|
||||||
import net.minecraft.entity.passive.EntityWolf;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenMapleWoods extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenMapleWoods()
|
|
||||||
{
|
|
||||||
super("maple_woods", new PropsBuilder("Maple Woods").withGuiColour(0x6AA369).withTemperature(0.25F).withRainfall(0.8F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(70).heightVariation(10, 25);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.BOREAL, 10);
|
|
||||||
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
||||||
|
|
||||||
// sand and gravel
|
|
||||||
this.addGenerator("sand", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(3).maxRadius(7).with(Blocks.SAND.getDefaultState()).create());
|
|
||||||
this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(6).maxRadius(7).with(Blocks.GRAVEL.getDefaultState()).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(15);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("maple", 5, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.OAK).leaves(BOPTrees.MAPLE).minHeight(5).maxHeight(10).create());
|
|
||||||
treeGenerator.add("spruce", 1, (new GeneratorTaigaTree.Builder()).minHeight(10).maxHeight(19).create()); // TODO: implement pine cones
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.2F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.1F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("violet", 1, (new GeneratorFlora.Builder().with(BOPFlowers.VIOLET).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(8.0F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(2.0F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("tanzanite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TANZANITE).create());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,98 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.monster.EntitySlime;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenMarsh extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
// TODO: fog color / closeness? what's that?
|
|
||||||
// TODO: should there be foliage colors / water colors?
|
|
||||||
|
|
||||||
public BiomeGenMarsh()
|
|
||||||
{
|
|
||||||
super("marsh", new PropsBuilder("Marsh").withGuiColour(0x66A06E).withTemperature(0.6F).withRainfall(0.8F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(62).heightVariation(5, 3).octaves(5, 5, 0, 0, 1, 1);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.LOAMY);
|
|
||||||
this.seaFloorBlock = BOPBlocks.mud.getDefaultState();
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.WET_TEMPERATE, 7);
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));
|
|
||||||
|
|
||||||
// lakes
|
|
||||||
this.addGenerator("lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.5F).waterLakeForBiome(this).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.KORU).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(10.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).generationAttempts(32).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(20.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("doublegrass", 10, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.GRASS).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,113 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLilypad;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBush;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTaigaTree;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityRabbit;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenMeadow extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenMeadow()
|
|
||||||
{
|
|
||||||
super("meadow", new PropsBuilder("Meadow").withGuiColour(0x63B26D).withTemperature(0.4F).withRainfall(0.7F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(5, 5).octaves(0, 1, 2, 2, 1, 0).sidewaysNoise(0.1D);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COOL_TEMPERATE, 3);
|
|
||||||
this.addWeight(BOPClimates.BOREAL, 7);
|
|
||||||
|
|
||||||
this.canGenerateVillages = true;
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
||||||
|
|
||||||
// sand
|
|
||||||
this.addGenerator("sand", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(3).maxRadius(7).with(Blocks.SAND.getDefaultState()).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(2);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("oak_bush", 4, (new GeneratorBush.Builder()).maxHeight(2).create());
|
|
||||||
treeGenerator.add("spruce", 4, (new GeneratorTaigaTree.Builder()).maxHeight(13).create()); // TODO: implement pine cones
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.8F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.5F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("clover", 2, (new GeneratorFlora.Builder().with(BOPFlowers.CLOVER).create()));
|
|
||||||
flowerGenerator.add("syringa", 1, (new GeneratorDoubleFlora.Builder().with(BlockDoublePlant.EnumPlantType.SYRINGA).create()));
|
|
||||||
flowerGenerator.add("sunflower", 2, (new GeneratorDoubleFlora.Builder().with(BlockDoublePlant.EnumPlantType.SUNFLOWER).create()));
|
|
||||||
flowerGenerator.add("rose", 1, (new GeneratorDoubleFlora.Builder().with(BlockDoublePlant.EnumPlantType.ROSE).create()));
|
|
||||||
flowerGenerator.add("white_anemones", 1, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE).create()));
|
|
||||||
flowerGenerator.add("houstonia", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.HOUSTONIA).create()));
|
|
||||||
flowerGenerator.add("oxeye_daisy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.BUSH).create());
|
|
||||||
this.addGenerator("flax", GeneratorStage.FLOWERS,(new GeneratorDoubleFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPDoublePlant.DoublePlantType.FLAX).generationAttempts(6).create());
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("clover_patches", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).generationAttempts(128).with(BOPPlants.CLOVERPATCH).create());
|
|
||||||
this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.4F).with(BOPPlants.SPROUT).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.15F).with(Blocks.WATERLILY.getDefaultState()).create());
|
|
||||||
this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.15F).with(BlockBOPLilypad.LilypadType.MEDIUM).create());
|
|
||||||
this.addGenerator("flower_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.15F).with(BlockBOPLilypad.LilypadType.FLOWER).create());
|
|
||||||
this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.15F).with(BlockBOPLilypad.LilypadType.SMALL).create());
|
|
||||||
this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.15F).with(BlockBOPLilypad.LilypadType.TINY).create());
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("peridot", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.PERIDOT).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x63B26D);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x63B26D);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,113 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenMoor extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenMoor()
|
|
||||||
{
|
|
||||||
super("moor", new PropsBuilder("Moor").withGuiColour(0x619365).withTemperature(0.6F).withRainfall(1.0F).withWaterColor(0x588276));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(88).heightVariation(8, 10).octaves(0, 1, 1, 3, 1, 0);
|
|
||||||
|
|
||||||
//this.skyColor =0xA0C5D3;
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.LOAMY);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COLD_SWAMP, 5);
|
|
||||||
|
|
||||||
// mud
|
|
||||||
this.addGenerator("mud", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(1).maxRadius(7).with(BOPBlocks.mud.getDefaultState()).create());
|
|
||||||
|
|
||||||
// lakes
|
|
||||||
this.addGenerator("lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(1.5F).waterLakeForBiome(this).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.6F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("swampflower", 1, (new GeneratorFlora.Builder()).with(BOPFlowers.SWAMPFLOWER).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(2.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("tallgrass", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("shortgrass", 3, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.6F).with(BOPPlants.KORU).create());
|
|
||||||
this.addGenerator("flax", GeneratorStage.FLOWERS,(new GeneratorDoubleFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPDoublePlant.DoublePlantType.FLAX).generationAttempts(6).create());
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(5.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x619365);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x619365);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,132 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 com.google.common.base.CaseFormat;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorPineTree;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.passive.EntityLlama;
|
|
||||||
import net.minecraft.entity.passive.EntitySheep;
|
|
||||||
import net.minecraft.entity.passive.EntityWolf;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenMountain extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public enum MountainType {MOUNTAIN, MOUNTAIN_FOOTHILLS}
|
|
||||||
|
|
||||||
public MountainType type;
|
|
||||||
public IBlockState grassBlock;
|
|
||||||
public IBlockState dirtBlock;
|
|
||||||
public IBlockState coarseDirtBlock;
|
|
||||||
public IBlockState stoneBlock;
|
|
||||||
|
|
||||||
public BiomeGenMountain(MountainType type)
|
|
||||||
{
|
|
||||||
super(type.name().toLowerCase(), new PropsBuilder(CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, type.toString())).withGuiColour(0x80A355).withTemperature(0.5F).withRainfall(0.1F));
|
|
||||||
|
|
||||||
this.type = type;
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case MOUNTAIN:
|
|
||||||
this.terrainSettings.avgHeight(140).heightVariation(30, 60).octaves(1, 1, 2, 2, 3, 3).sidewaysNoise(0.1D);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MOUNTAIN_FOOTHILLS:
|
|
||||||
this.terrainSettings.avgHeight(100).heightVariation(15, 30).octaves(0, 1, 1, 3, 1, 0).sidewaysNoise(0.1D);
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
if (type == MountainType.MOUNTAIN)
|
|
||||||
{
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
// peaks are created in the biome gen layer, foothills don't have a weight - they only appear later around the peaks (in the biome edge layer)
|
|
||||||
this.addWeight(BOPClimates.DRY_TEMPERATE, 3);
|
|
||||||
|
|
||||||
// only sheep and wolves on the peaks
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntitySheep.class, 12, 4, 6));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 4, 4, 4));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityLlama.class, 5, 4, 6));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.topBlock = Blocks.GRASS.getDefaultState();
|
|
||||||
this.fillerBlock = Blocks.DIRT.getDefaultState();
|
|
||||||
|
|
||||||
// gravel
|
|
||||||
this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(6).maxRadius(7).with(Blocks.GRAVEL.getDefaultState()).create());
|
|
||||||
|
|
||||||
// lakes
|
|
||||||
this.addGenerator("lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(1.8F).waterLakeForBiome(this).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
IBlockPosQuery suitableTreePosition = BlockQuery.buildAnd().withAltitudeBetween(64, 140).materials(Material.GROUND, Material.GRASS).create();
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(3);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("pine", 2, (new GeneratorPineTree.Builder()).minHeight(6).maxHeight(18).log(BOPWoods.PINE).leaves(BOPTrees.PINE).placeOn(suitableTreePosition).create());
|
|
||||||
treeGenerator.add("oak", 1, (new GeneratorBasicTree.Builder()).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.5F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).generationAttempts(128).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).generationAttempts(128).create());
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).generationAttempts(128).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).generationAttempts(128).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).generationAttempts(128).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).generationAttempts(type == MountainType.MOUNTAIN_FOOTHILLS ? 64 : 32).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.8F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.2F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
|
|
||||||
if (type == MountainType.MOUNTAIN_FOOTHILLS)
|
|
||||||
{
|
|
||||||
this.addGenerator("flax", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPDoublePlant.DoublePlantType.FLAX).create());
|
|
||||||
this.addGenerator("berry_bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.BERRYBUSH).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.4F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("emeralds", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(Blocks.EMERALD_ORE.getDefaultState()).create());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,146 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLeaves;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLilypad;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorBigMushroom;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockOldLeaf;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.monster.EntityWitch;
|
|
||||||
import net.minecraft.entity.passive.EntityRabbit;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenMysticGrove extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenMysticGrove()
|
|
||||||
{
|
|
||||||
super("mystic_grove", new PropsBuilder("Mystic Grove").withGuiColour(0x69CFDB).withTemperature(0.7F).withRainfall(0.8F).withWaterColor(0xFF107A));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(63).heightVariation(5, 20);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SILTY);
|
|
||||||
|
|
||||||
this.skyColor = 0x88E8D0;
|
|
||||||
this.fogColor = 0xFFAAC9;
|
|
||||||
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.WET_TEMPERATE, 1);
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityWitch.class, 10, 4, 4));
|
|
||||||
|
|
||||||
// hot springs
|
|
||||||
this.addGenerator("hot_springs", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.5F).liquid(BOPBlocks.hot_spring_water).frozenLiquid((IBlockState)null).create());
|
|
||||||
|
|
||||||
// lakes
|
|
||||||
this.addGenerator("poison_lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.1F).liquid(BOPBlocks.poison).frozenLiquid((IBlockState)null).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(10);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("ivy_tree", 7, (new GeneratorBasicTree.Builder()).minHeight(5).maxHeight(9).maxLeavesRadius(2).leaves(Blocks.LEAVES.getDefaultState().withProperty(BlockOldLeaf.CHECK_DECAY, Boolean.valueOf(false))).vine(BOPBlocks.ivy.getDefaultState()).create());
|
|
||||||
treeGenerator.add("magic", 17, (new GeneratorBasicTree.Builder()).log(BOPWoods.MAGIC).leaves(BOPTrees.MAGIC).create());
|
|
||||||
treeGenerator.add("jacaranda", 9, (new GeneratorBasicTree.Builder()).minHeight(4).maxHeight(7).log(BOPWoods.JACARANDA).leaves(BOPTrees.JACARANDA).create());
|
|
||||||
treeGenerator.add("oak_large", 8, (new GeneratorBigTree.Builder()).altLeaves(BlockBOPLeaves.paging.getVariantState(BOPTrees.FLOWERING).withProperty(BlockOldLeaf.CHECK_DECAY, Boolean.valueOf(false))).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.5F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(1.5F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("clover", 1, (new GeneratorFlora.Builder().with(BOPFlowers.CLOVER).create()));
|
|
||||||
flowerGenerator.add("blue_hydrangeas", 2, (new GeneratorFlora.Builder().with(BOPFlowers.BLUE_HYDRANGEA).create()));
|
|
||||||
flowerGenerator.add("syringa", 1, (new GeneratorDoubleFlora.Builder().with(BlockDoublePlant.EnumPlantType.SYRINGA).create()));
|
|
||||||
flowerGenerator.add("glowflower", 5, (new GeneratorFlora.Builder().with(BOPFlowers.GLOWFLOWER).create()));
|
|
||||||
flowerGenerator.add("houstonia", 3, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.HOUSTONIA).create()));
|
|
||||||
flowerGenerator.add("pink_daffodil", 2, (new GeneratorFlora.Builder().with(BOPFlowers.PINK_DAFFODIL).create()));
|
|
||||||
flowerGenerator.add("white_anemones", 1, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE).create()));
|
|
||||||
flowerGenerator.add("oxeye_daisy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
//other plants
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).create());
|
|
||||||
this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.25F).with(BOPPlants.SPROUT).create());
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("clover_patches", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).generationAttempts(128).with(BOPPlants.CLOVERPATCH).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(Blocks.WATERLILY.getDefaultState()).create());
|
|
||||||
this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPLilypad.LilypadType.MEDIUM).create());
|
|
||||||
this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPLilypad.LilypadType.SMALL).create());
|
|
||||||
this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPLilypad.LilypadType.TINY).create());
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(1.0F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("flower_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.FLOWER).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("blue_milk_caps", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.BLUE_MILK_CAP).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.4F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("big_red_mushroom", GeneratorStage.BIG_SHROOM,(new GeneratorBigMushroom.Builder()).amountPerChunk(0.4F).mushroomType(GeneratorBigMushroom.BigMushroomType.RED).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("topaz", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TOPAZ).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x69CFDB);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x70E099);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,90 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLeaves;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorPalmTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
|
||||||
import net.minecraft.block.BlockOldLeaf;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.entity.passive.EntityRabbit;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenOasis extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenOasis()
|
|
||||||
{
|
|
||||||
super("oasis", new PropsBuilder("Oasis").withGuiColour(7712283).withTemperature(2.0F).withRainfall(0.5F).withRainDisabled());
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(62).heightVariation(5, 7);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
|
|
||||||
this.topBlock = Blocks.SAND.getDefaultState();
|
|
||||||
this.fillerBlock = Blocks.SAND.getDefaultState();
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
||||||
|
|
||||||
clearWeights();
|
|
||||||
|
|
||||||
// lakes
|
|
||||||
//this.addGenerator("lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(1.2F).waterLakeForBiome(this).create());
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(4.0F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("palm", 3, (new GeneratorPalmTree.Builder()).placeOn(BlockQueries.litSand).log(BOPWoods.PALM).leaves(BlockBOPLeaves.paging.getVariantState(BOPTrees.PALM).withProperty(BlockOldLeaf.DECAYABLE, Boolean.valueOf(false))).create());
|
|
||||||
treeGenerator.add("jungle_twiglet", 2, (new GeneratorTwigletTree.Builder()).placeOn(BlockQueries.litSand).minHeight(2).maxHeight(2).log(BlockPlanks.EnumType.JUNGLE).leaves(BlockPlanks.EnumType.JUNGLE).trunkFruit(Blocks.COCOA.getDefaultState()).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("dunegrass", GeneratorStage.GRASS, (new GeneratorGrass.Builder()).amountPerChunk(10.0F).with(BOPPlants.DUNEGRASS).placeOn(BlockQueries.litDry).generationAttempts(8).create());
|
|
||||||
this.addGenerator("desert_sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(5.0F).with(BOPPlants.DESERTSPROUTS).generationAttempts(8).create());
|
|
||||||
this.addGenerator("desertgrass", GeneratorStage.GRASS, (new GeneratorGrass.Builder()).amountPerChunk(1.0F).with(BOPPlants.DESERTGRASS).generationAttempts(8).create());
|
|
||||||
this.addGenerator("bromeliad", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder().amountPerChunk(0.2F).with(BOPFlowers.BROMELIAD).generationAttempts(8).create()));
|
|
||||||
this.addGenerator("tiny_cacti", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.TINYCACTUS).generationAttempts(8).create());
|
|
||||||
this.addGenerator("sugar_cane", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(2.0F).generationAttempts(24).placeOn(BlockQueries.litDryWaterside).with(Blocks.REEDS.getDefaultState()).minHeight(1).maxHeight(3).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("ruby", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.RUBY).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,132 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLeaves;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorBramble;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTaigaTree;
|
|
||||||
import net.minecraft.block.BlockOldLeaf;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenOminousWoods extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
|
|
||||||
public BiomeGenOminousWoods()
|
|
||||||
{
|
|
||||||
super("ominous_woods", new PropsBuilder("Ominous Woods").withGuiColour(0x3F4151).withTemperature(0.6F).withRainfall(0.6F).withWaterColor(0x1E1B26));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(66).heightVariation(5, 10);
|
|
||||||
|
|
||||||
this.skyColor = 0x384460;
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.LOAMY);
|
|
||||||
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.fogColor = 0x3B3D4C;
|
|
||||||
this.fogDensity = 0.175F;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COLD_SWAMP, 1);
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
|
|
||||||
// lakes
|
|
||||||
this.addGenerator("poison_lakes", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.1F).liquid(BOPBlocks.poison).frozenLiquid((IBlockState)null).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(11);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("willow_tree", 3, (new GeneratorBasicTree.Builder()).log(BOPWoods.WILLOW).leaves(BlockBOPLeaves.paging.getVariantState(BOPTrees.WILLOW).withProperty(BlockOldLeaf.CHECK_DECAY, Boolean.valueOf(false))).minHeight(5).maxHeight(9).maxLeavesRadius(2).vine(BOPBlocks.willow_vine.getDefaultState()).create());
|
|
||||||
treeGenerator.add("umbran_spruce", 4, (new GeneratorTaigaTree.Builder()).log(BOPWoods.UMBRAN).leaves(BOPTrees.UMBRAN).maxHeight(20).create()); // TODO: implement pine cones
|
|
||||||
treeGenerator.add("dead_tree", 2, (new GeneratorBigTree.Builder()).minHeight(5).maxHeight(12).foliageHeight(0).foliageDensity(0.5D).log(BOPWoods.DEAD).leaves(Blocks.AIR.getDefaultState()).create());
|
|
||||||
treeGenerator.add("mega_umbran", 5, (new GeneratorTaigaTree.Builder()).log(BOPWoods.UMBRAN).leaves(BOPTrees.UMBRAN).minHeight(20).maxHeight(30).trunkWidth(2).create());
|
|
||||||
treeGenerator.add("dying_tree", 1, (new GeneratorBigTree.Builder()).minHeight(5).maxHeight(12).foliageHeight(1).log(BOPWoods.DEAD).leaves(BOPTrees.DEAD).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(3.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 3, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.4F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("deathbloom", 2, (new GeneratorFlora.Builder()).with(BOPFlowers.DEATHBLOOM).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("bramble", GeneratorStage.FLOWERS,(new GeneratorBramble.Builder()).maxHeight(4).minLength(5).maxLength(15).amountPerChunk(0.75F).create());
|
|
||||||
this.addGenerator("poison_ivy", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BOPPlants.POISONIVY).create());
|
|
||||||
this.addGenerator("thorns", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BOPPlants.THORN).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x43415B);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x5A4166);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,87 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityDonkey;
|
|
||||||
import net.minecraft.entity.passive.EntityHorse;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenOrchard extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenOrchard()
|
|
||||||
{
|
|
||||||
super("orchard", new PropsBuilder("Orchard").withGuiColour(14024557).withTemperature(0.7F).withRainfall(0.7F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(4, 15);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.WARM_TEMPERATE, 3);
|
|
||||||
|
|
||||||
this.canGenerateVillages = true;
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 1, 2, 6));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityDonkey.class, 1, 1, 1));
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(3.5F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("oak", 2, (new GeneratorBasicTree.Builder()).altLeaves(BOPTrees.FLOWERING).create());
|
|
||||||
treeGenerator.add("oak_large", 1, (new GeneratorBigTree.Builder()).altLeaves(BOPTrees.FLOWERING).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.5F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 3, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 4, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 6, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(1.5F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("white_anemones", 1, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE).generationAttempts(16).create()));
|
|
||||||
flowerGenerator.add("houstonia", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.HOUSTONIA).create()));
|
|
||||||
flowerGenerator.add("oxeye_daisy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("berry_bushes", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.4F).with(BOPPlants.BERRYBUSH).generationAttempts(8).create());
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(1).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(1).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).generationAttempts(32).create());
|
|
||||||
this.addGenerator("flax", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPDoublePlant.DoublePlantType.FLAX).generationAttempts(8).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("peridot", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.PERIDOT).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(14024557);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(14024557);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,94 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.config.IBOPWorldSettings;
|
|
||||||
import biomesoplenty.api.config.IBOPWorldSettings.GeneratorType;
|
|
||||||
import net.minecraft.entity.monster.EntityCreeper;
|
|
||||||
import net.minecraft.entity.monster.EntitySkeleton;
|
|
||||||
import net.minecraft.entity.monster.EntitySpider;
|
|
||||||
import net.minecraft.entity.monster.EntityZombie;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenOriginBeach extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenOriginBeach()
|
|
||||||
{
|
|
||||||
super("origin_beach", new PropsBuilder("Origin Beach").withGuiColour(10341485).withTemperature(0.6F).withRainfall(0.6F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(1, 1);
|
|
||||||
|
|
||||||
this.skyColor = 8441086;
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
|
|
||||||
this.spawnableWaterCreatureList.clear();
|
|
||||||
this.spawnableCaveCreatureList.clear();
|
|
||||||
this.spawnableMonsterList.clear();
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntitySpider.class, 100, 4, 4));
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityZombie.class, 100, 4, 4));
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityCreeper.class, 100, 4, 4));
|
|
||||||
|
|
||||||
this.decorator.treesPerChunk = -999;
|
|
||||||
this.decorator.deadBushPerChunk = 0;
|
|
||||||
this.decorator.reedsPerChunk = 0;
|
|
||||||
this.decorator.cactiPerChunk = 0;
|
|
||||||
|
|
||||||
clearWeights();
|
|
||||||
|
|
||||||
this.topBlock = Blocks.SAND.getDefaultState();
|
|
||||||
this.fillerBlock = Blocks.SAND.getDefaultState();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void applySettings(IBOPWorldSettings settings)
|
|
||||||
{
|
|
||||||
this.removeGenerator("roots");
|
|
||||||
this.removeGenerator("glowshrooms");
|
|
||||||
this.removeGenerator("miners_delight");
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.GEMS)) {this.removeGenerator("ruby"); this.removeGenerator("topaz");
|
|
||||||
this.removeGenerator("amber"); this.removeGenerator("peridot"); this.removeGenerator("malachite");
|
|
||||||
this.removeGenerator("sapphire"); this.removeGenerator("tanzanite"); this.removeGenerator("amethyst");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.POISON_IVY)) {this.removeGenerator("poison_ivy");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.BERRY_BUSHES)) {this.removeGenerator("berry_bushes");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.NETHER_HIVES)) {this.removeGenerator("hive");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.THORNS)) {this.removeGenerator("thorns");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.QUICKSAND)) {this.removeGenerator("quicksand");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.HOT_SPRINGS)) {this.removeGenerator("hot_springs");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.LIQUID_POISON)) {this.removeGenerator("poison_lakes");}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(10682207);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(3866368);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,119 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.config.IBOPWorldSettings;
|
|
||||||
import biomesoplenty.api.config.IBOPWorldSettings.GeneratorType;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass.BOPGrassType;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import net.minecraft.block.BlockFlower.EnumFlowerType;
|
|
||||||
import net.minecraft.entity.monster.EntityCreeper;
|
|
||||||
import net.minecraft.entity.monster.EntitySkeleton;
|
|
||||||
import net.minecraft.entity.monster.EntitySpider;
|
|
||||||
import net.minecraft.entity.monster.EntityZombie;
|
|
||||||
import net.minecraft.entity.passive.EntityChicken;
|
|
||||||
import net.minecraft.entity.passive.EntityCow;
|
|
||||||
import net.minecraft.entity.passive.EntityPig;
|
|
||||||
import net.minecraft.entity.passive.EntitySheep;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenOriginIsland extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenOriginIsland()
|
|
||||||
{
|
|
||||||
super("origin_island", new PropsBuilder("Origin Island").withGuiColour(10341485).withTemperature(0.6F).withRainfall(0.6F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(6, 25).sidewaysNoise(0.0D);
|
|
||||||
|
|
||||||
if (BOPBiomes.origin_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.origin_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.skyColor = 8441086;
|
|
||||||
|
|
||||||
this.canSpawnInBiome = true;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
|
|
||||||
clearWeights();
|
|
||||||
|
|
||||||
this.spawnableWaterCreatureList.clear();
|
|
||||||
this.spawnableCaveCreatureList.clear();
|
|
||||||
this.spawnableMonsterList.clear();
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntitySheep.class, 12, 4, 4));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 10, 4, 4));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 8, 4, 4));
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntitySpider.class, 100, 4, 4));
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityZombie.class, 100, 4, 4));
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityCreeper.class, 100, 4, 4));
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BOPGrassType.ORIGIN);
|
|
||||||
|
|
||||||
// trees
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, (new GeneratorBasicTree.Builder()).amountPerChunk(5).minHeight(5).maxHeight(8).leaves(BOPTrees.ORIGIN).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.4F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("rose", 8, (new GeneratorFlora.Builder().with(BOPFlowers.ROSE).create()));
|
|
||||||
flowerGenerator.add("yellow_flower", 10, (new GeneratorFlora.Builder().with(EnumFlowerType.DANDELION).create()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void applySettings(IBOPWorldSettings settings)
|
|
||||||
{
|
|
||||||
this.removeGenerator("roots");
|
|
||||||
this.removeGenerator("glowshrooms");
|
|
||||||
this.removeGenerator("miners_delight");
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.GEMS)) {this.removeGenerator("ruby"); this.removeGenerator("topaz");
|
|
||||||
this.removeGenerator("amber"); this.removeGenerator("peridot"); this.removeGenerator("malachite");
|
|
||||||
this.removeGenerator("sapphire"); this.removeGenerator("tanzanite"); this.removeGenerator("amethyst");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.POISON_IVY)) {this.removeGenerator("poison_ivy");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.BERRY_BUSHES)) {this.removeGenerator("berry_bushes");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.NETHER_HIVES)) {this.removeGenerator("hive");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.THORNS)) {this.removeGenerator("thorns");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.QUICKSAND)) {this.removeGenerator("quicksand");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.HOT_SPRINGS)) {this.removeGenerator("hot_springs");}
|
|
||||||
|
|
||||||
if (!settings.isEnabled(GeneratorType.LIQUID_POISON)) {this.removeGenerator("poison_lakes");}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(10682207);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(3866368);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,97 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorColumns;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplatter;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBush;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockSand;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityRabbit;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenOutback extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenOutback()
|
|
||||||
{
|
|
||||||
super("outback", new PropsBuilder("Outback").withGuiColour(0xA57644).withTemperature(2.0F).withRainfall(0.05F).withRainDisabled());
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(72).heightVariation(8, 10).octaves(0, 1, 2, 1, 0, 2);
|
|
||||||
|
|
||||||
this.topBlock = Blocks.SAND.getDefaultState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND);
|
|
||||||
this.fillerBlock = Blocks.SAND.getDefaultState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.HOT_DESERT, 7);
|
|
||||||
|
|
||||||
this.canGenerateVillages = true;
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 4, 2, 3));
|
|
||||||
|
|
||||||
// splatter top blocks
|
|
||||||
IBlockPosQuery emptyRedSand = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create();
|
|
||||||
this.addGenerator("grass_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(4.0F).generationAttempts(128).replace(emptyRedSand).with(BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SANDY)).create());
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(3);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("acacia_bush", 1, (new GeneratorBush.Builder()).log(BlockPlanks.EnumType.ACACIA).leaves(BlockPlanks.EnumType.ACACIA).maxHeight(2).create());
|
|
||||||
treeGenerator.add("acacia_twiglet", 1, (new GeneratorTwigletTree.Builder()).minHeight(2).maxHeight(2).log(BlockPlanks.EnumType.ACACIA).leaves(BlockPlanks.EnumType.ACACIA).create());
|
|
||||||
|
|
||||||
// grasses (note weighting must be quite high as the grasses will only grow on the splattered grass blocks)
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(16.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("tiny_cacti", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.TINYCACTUS).create());
|
|
||||||
this.addGenerator("dead_bushes", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.5F).with(Blocks.DEADBUSH.getDefaultState()).create());
|
|
||||||
this.addGenerator("cacti", GeneratorStage.FLOWERS,(new GeneratorColumns.Builder()).amountPerChunk(0.2F).generationAttempts(24).placeOn(this.topBlock).with(Blocks.CACTUS.getDefaultState()).minHeight(1).maxHeight(2).create());
|
|
||||||
this.addGenerator("desertgrass", GeneratorStage.GRASS, (new GeneratorGrass.Builder()).amountPerChunk(10.0F).with(BOPPlants.DESERTGRASS).generationAttempts(8).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("ruby", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.RUBY).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,118 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBush;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorMahoganyTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTwigletTree;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.passive.EntityOcelot;
|
|
||||||
import net.minecraft.entity.passive.EntityParrot;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
|
|
||||||
public class BiomeGenOvergrownCliffs extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public IBlockState usualTopBlock;
|
|
||||||
public IBlockState usualFillerBlock;
|
|
||||||
public IBlockState alternateTopBlock;
|
|
||||||
public IBlockState alternateFillerBlock;
|
|
||||||
|
|
||||||
public BiomeGenOvergrownCliffs()
|
|
||||||
{
|
|
||||||
super("overgrown_cliffs", new PropsBuilder("Overgrown Cliffs").withGuiColour(8373350).withTemperature(0.95F).withRainfall(0.75F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(70).heightVariation(5, 100).octaves(1, 1, 1, 1, 0, 0).sidewaysNoise(0.0F);
|
|
||||||
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.OVERGROWN_STONE);
|
|
||||||
this.fillerBlock = Blocks.STONE.getDefaultState();
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.usualFillerBlock = this.fillerBlock;
|
|
||||||
this.alternateTopBlock = Blocks.GRASS.getDefaultState();
|
|
||||||
this.alternateFillerBlock = Blocks.DIRT.getDefaultState();
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.TROPICAL, 2);
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityParrot.class, 40, 1, 2));
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(40.0F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("mahogany", 1, (new GeneratorMahoganyTree.Builder()).minHeight(5).maxHeight(10).create());
|
|
||||||
treeGenerator.add("oak_bush", 8, (new GeneratorBush.Builder()).maxHeight(2).create());
|
|
||||||
treeGenerator.add("jungle_twiglet", 2, (new GeneratorTwigletTree.Builder()).minHeight(2).maxHeight(2).log(BlockPlanks.EnumType.JUNGLE).leaves(BlockPlanks.EnumType.JUNGLE).trunkFruit(Blocks.COCOA.getDefaultState()).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.25F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.25F).with(BOPPlants.SPROUT).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(1.5F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("orange_cosmos", 4, (new GeneratorFlora.Builder().with(BOPFlowers.ORANGE_COSMOS).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(2.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("emeralds", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(Blocks.EMERALD_ORE.getDefaultState()).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
super.configure(conf);
|
|
||||||
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.usualFillerBlock = this.fillerBlock;
|
|
||||||
this.alternateTopBlock = conf.getBlockState("alternateTopBlock", this.alternateTopBlock);
|
|
||||||
this.alternateFillerBlock = conf.getBlockState("alternateFillerBlock", this.alternateFillerBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
|
|
||||||
{
|
|
||||||
this.topBlock = (noise + rand.nextDouble() * 1.0D > 1.8D) ? this.alternateTopBlock : this.usualTopBlock;
|
|
||||||
this.fillerBlock = (noise + rand.nextDouble() * 1.0D > 1.8D) ? this.alternateFillerBlock : this.usualFillerBlock;
|
|
||||||
super.genTerrainBlocks(world, rand, primer, x, z, noise);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,61 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class BiomeGenPasture extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenPasture()
|
|
||||||
{
|
|
||||||
super("pasture", new PropsBuilder("Pasture").withGuiColour(0xC8E580).withTemperature(0.8F).withRainfall(0.3F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(4, 6);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SILTY);
|
|
||||||
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
|
|
||||||
clearWeights();
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(0.5F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 3, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 6, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
this.addGenerator("barley", GeneratorStage.GRASS,(new GeneratorFlora.Builder()).amountPerChunk(45.0F).with(BOPPlants.BARLEY).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(1).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("peridot", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.PERIDOT).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(13165952);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(11395195);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,95 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityDonkey;
|
|
||||||
import net.minecraft.entity.passive.EntityHorse;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
|
||||||
|
|
||||||
public class BiomeGenPrairie extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenPrairie()
|
|
||||||
{
|
|
||||||
super("prairie", new PropsBuilder("Prairie").withGuiColour(0xC8E580).withTemperature(0.8F).withRainfall(0.3F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(4, 6);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY);
|
|
||||||
this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SILTY);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.WARM_TEMPERATE, 7);
|
|
||||||
|
|
||||||
this.canGenerateVillages = true;
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 1, 2, 6));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityDonkey.class, 1, 1, 1));
|
|
||||||
|
|
||||||
// sand
|
|
||||||
this.addGenerator("sand", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(3).maxRadius(7).with(Blocks.SAND.getDefaultState()).create());
|
|
||||||
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(0.3F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("oak_tree", 3, (new GeneratorBigTree.Builder()).minHeight(7).maxHeight(12).foliageHeight(1).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(10);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 3, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 6, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
this.addGenerator("doublegrass", GeneratorStage.GRASS,(new GeneratorDoubleFlora.Builder()).amountPerChunk(0.5F).with(BlockDoublePlant.EnumPlantType.GRASS).generationAttempts(128).create());
|
|
||||||
|
|
||||||
this.addGenerator("goldenrods", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.0F).with(BOPFlowers.GOLDENROD).generationAttempts(64).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.4F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("white_anemones", 1, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE).generationAttempts(16).create()));
|
|
||||||
flowerGenerator.add("houstonia", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.HOUSTONIA).create()));
|
|
||||||
flowerGenerator.add("oxeye_daisy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(1).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
this.addGenerator("flax", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPDoublePlant.DoublePlantType.FLAX).generationAttempts(8).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("peridot", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.PERIDOT).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(13165952);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(11395195);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,169 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.IBlockPosQuery;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDirt;
|
|
||||||
import biomesoplenty.common.block.BlockBOPGrass;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLilypad;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.util.block.BlockQuery;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorSplatter;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.monster.EntitySlime;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
import net.minecraft.world.gen.feature.WorldGenFossils;
|
|
||||||
|
|
||||||
public class BiomeGenQuagmire extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public IBlockState usualTopBlock;
|
|
||||||
public IBlockState usualFillerBlock;
|
|
||||||
public IBlockState alternateTopBlock;
|
|
||||||
public IBlockState alternateFillerBlock;
|
|
||||||
|
|
||||||
public BiomeGenQuagmire()
|
|
||||||
{
|
|
||||||
super("quagmire", new PropsBuilder("Quagmire").withGuiColour(0x503A2B).withTemperature(0.6F).withRainfall(0.9F).withWaterColor(0xCC5100));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(63).heightVariation(5, 10).octaves(1, 1, 1, 1, 0, 0).sidewaysNoise(0.0F);
|
|
||||||
|
|
||||||
this.topBlock = BOPBlocks.mud.getDefaultState();
|
|
||||||
this.fillerBlock = BOPBlocks.mud.getDefaultState();
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.usualFillerBlock = this.fillerBlock;
|
|
||||||
this.alternateTopBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY);
|
|
||||||
this.alternateFillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.LOAMY);
|
|
||||||
//this.skyColor = 0xBDC4BE;
|
|
||||||
this.seaFloorBlock = BOPBlocks.mud.getDefaultState();
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COLD_SWAMP, 2);
|
|
||||||
|
|
||||||
this.spawnableCreatureList.clear();
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));
|
|
||||||
|
|
||||||
// splatter top blocks
|
|
||||||
IBlockPosQuery emptyMud = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create();
|
|
||||||
this.addGenerator("grass_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(1.0F).generationAttempts(128).replace(emptyMud).with(BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY)).create());
|
|
||||||
|
|
||||||
// mud
|
|
||||||
this.addGenerator("mud", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(10).maxRadius(8).with(BOPBlocks.mud.getDefaultState()).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.4F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 5, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 3, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 1, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BOPPlants.KORU).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(Blocks.WATERLILY.getDefaultState()).create());
|
|
||||||
this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPLilypad.LilypadType.MEDIUM).create());
|
|
||||||
this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPLilypad.LilypadType.SMALL).create());
|
|
||||||
this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BlockBOPLilypad.LilypadType.TINY).create());
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
super.configure(conf);
|
|
||||||
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.usualFillerBlock = this.fillerBlock;
|
|
||||||
this.alternateTopBlock = conf.getBlockState("alternateTopBlock", this.alternateTopBlock);
|
|
||||||
this.alternateFillerBlock = conf.getBlockState("alternateFillerBlock", this.alternateFillerBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
|
|
||||||
{
|
|
||||||
this.topBlock = (noise + rand.nextDouble() * 1.0D > 1.8D) ? this.alternateTopBlock : this.usualTopBlock;
|
|
||||||
this.fillerBlock = (noise + rand.nextDouble() * 1.0D > 1.8D) ? this.alternateFillerBlock : this.usualFillerBlock;
|
|
||||||
|
|
||||||
double d0 = GRASS_COLOR_NOISE.getValue((double)x * 0.2D, (double)z * 0.2D);
|
|
||||||
|
|
||||||
if (d0 > 0.0D)
|
|
||||||
{
|
|
||||||
int i = x & 15;
|
|
||||||
int j = z & 15;
|
|
||||||
|
|
||||||
for (int k = 255; k >= 0; --k)
|
|
||||||
{
|
|
||||||
if (primer.getBlockState(j, k, i).getMaterial() != Material.AIR)
|
|
||||||
{
|
|
||||||
if (k == 62 && primer.getBlockState(j, k, i).getBlock() != Blocks.WATER)
|
|
||||||
{
|
|
||||||
primer.setBlockState(j, k, i, WATER);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
super.genTerrainBlocks(world, rand, primer, x, z, noise);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void decorate(World worldIn, Random rand, BlockPos pos)
|
|
||||||
{
|
|
||||||
super.decorate(worldIn, rand, pos);
|
|
||||||
|
|
||||||
if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FOSSIL))
|
|
||||||
if (rand.nextInt(64) == 0)
|
|
||||||
{
|
|
||||||
(new WorldGenFossils()).generate(worldIn, rand, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x938060);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0xAAA072);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,111 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLeaves;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLilypad;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorPalmTree;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockOldLeaf;
|
|
||||||
import net.minecraft.block.BlockFlower.EnumFlowerType;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityOcelot;
|
|
||||||
import net.minecraft.entity.passive.EntityParrot;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class BiomeGenRainforest extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenRainforest()
|
|
||||||
{
|
|
||||||
super("rainforest", new PropsBuilder("Rainforest").withGuiColour(0x14E26F).withTemperature(0.95F).withRainfall(1.2F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(80).heightVariation(50, 50).sidewaysNoise(1.5D);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.TROPICAL, 7);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1));
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityParrot.class, 40, 1, 2));
|
|
||||||
|
|
||||||
// aand
|
|
||||||
this.addGenerator("sand", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(3).maxRadius(7).with(Blocks.SAND.getDefaultState()).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(15);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("palm", 3, (new GeneratorPalmTree.Builder()).log(BOPWoods.PALM).minHeight(15).maxHeight(20).leaves(BlockBOPLeaves.paging.getVariantState(BOPTrees.PALM).withProperty(BlockOldLeaf.DECAYABLE, Boolean.valueOf(false))).create());
|
|
||||||
treeGenerator.add("oak", 7, (new GeneratorBasicTree.Builder()).minHeight(8).maxHeight(12).altLeaves(BOPTrees.FLOWERING).create());
|
|
||||||
treeGenerator.add("jungle", 1, (new GeneratorBasicTree.Builder()).minHeight(8).maxHeight(12).log(BlockPlanks.EnumType.JUNGLE).leaves(BlockPlanks.EnumType.JUNGLE).trunkFruit(Blocks.COCOA.getDefaultState()).create());
|
|
||||||
treeGenerator.add("large_oak", 4, (new GeneratorBigTree.Builder()).log(BlockPlanks.EnumType.OAK).leaves(BlockPlanks.EnumType.OAK).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(3.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("fern", 4, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.FERN).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(1.5F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("pink_daffodil", 3, (new GeneratorFlora.Builder().with(BOPFlowers.PINK_DAFFODIL).create()));
|
|
||||||
flowerGenerator.add("blue_hydrangeas", 2, (new GeneratorFlora.Builder().with(BOPFlowers.BLUE_HYDRANGEA).create()));
|
|
||||||
flowerGenerator.add("orange_cosmos", 4, (new GeneratorFlora.Builder().with(BOPFlowers.ORANGE_COSMOS).create()));
|
|
||||||
flowerGenerator.add("blue_orchid", 2, (new GeneratorFlora.Builder().with(EnumFlowerType.BLUE_ORCHID).create()));
|
|
||||||
flowerGenerator.add("oxeye_daisy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).generationAttempts(64).create());
|
|
||||||
this.addGenerator("clover_patches", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).generationAttempts(128).with(BOPPlants.CLOVERPATCH).create());
|
|
||||||
this.addGenerator("rafflesia", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.RAFFLESIA).create());
|
|
||||||
this.addGenerator("melons", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.015625F).placeOn(this.topBlock).with(Blocks.MELON_BLOCK.getDefaultState()).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(Blocks.WATERLILY.getDefaultState()).create());
|
|
||||||
this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BlockBOPLilypad.LilypadType.MEDIUM).create());
|
|
||||||
this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.SMALL).create());
|
|
||||||
this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.TINY).create());
|
|
||||||
this.addGenerator("flower_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.FLOWER).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("topaz", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TOPAZ).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x1AD86C);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x14E26F);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,121 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import com.google.common.base.CaseFormat;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBush;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorRedwoodTree;
|
|
||||||
import net.minecraft.block.BlockDirt;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
|
|
||||||
public class BiomeGenRedwoodForest extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public enum ForestType {REDWOOD_FOREST, REDWOOD_FOREST_EDGE}
|
|
||||||
public IBlockState usualTopBlock;
|
|
||||||
public IBlockState alternateTopBlock;
|
|
||||||
|
|
||||||
public ForestType type;
|
|
||||||
|
|
||||||
public BiomeGenRedwoodForest(ForestType type)
|
|
||||||
{
|
|
||||||
super(type.name().toLowerCase(), new PropsBuilder(CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, type.toString())).withGuiColour(0x6DAA3C).withTemperature(0.7F).withRainfall(0.7F));
|
|
||||||
|
|
||||||
this.type = type;
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(70).heightVariation(4, 10);
|
|
||||||
|
|
||||||
this.topBlock = Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL);
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = this.topBlock;
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
|
|
||||||
if (type == ForestType.REDWOOD_FOREST)
|
|
||||||
{
|
|
||||||
this.addWeight(BOPClimates.WARM_TEMPERATE, 7);
|
|
||||||
|
|
||||||
//trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(15.0F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("redwood", 6, (new GeneratorRedwoodTree.Builder()).log(BOPWoods.REDWOOD).leaves(BOPTrees.REDWOOD).minHeight(45).maxHeight(60).trunkWidth(3).create());
|
|
||||||
treeGenerator.add("redwood_medium", 4, (new GeneratorRedwoodTree.Builder()).log(BOPWoods.REDWOOD).leaves(BOPTrees.REDWOOD).minHeight(25).maxHeight(40).trunkWidth(2).create());
|
|
||||||
treeGenerator.add("redwood_small", 2, (new GeneratorRedwoodTree.Builder()).log(BOPWoods.REDWOOD).leaves(BOPTrees.REDWOOD).minHeight(10).maxHeight(30).trunkWidth(1).create());
|
|
||||||
treeGenerator.add("oak_bush", 1, (new GeneratorBush.Builder()).amountPerChunk(3).maxHeight(2).create());
|
|
||||||
treeGenerator.add("oak_tree", 1, (new GeneratorBigTree.Builder()).amountPerChunk(1.0F).minHeight(4).maxHeight(10).foliageHeight(1).create());
|
|
||||||
|
|
||||||
this.addGenerator("double_fern", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(5.0F).with(BlockDoublePlant.EnumPlantType.FERN).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (type == ForestType.REDWOOD_FOREST_EDGE)
|
|
||||||
{
|
|
||||||
this.hasBiomeEssence = false;
|
|
||||||
this.alternateTopBlock = Blocks.GRASS.getDefaultState();
|
|
||||||
|
|
||||||
// trees
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(8.0F);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("redwood_small", 6, (new GeneratorRedwoodTree.Builder()).log(BOPWoods.REDWOOD).leaves(BOPTrees.REDWOOD).minHeight(10).maxHeight(30).trunkWidth(1).create());
|
|
||||||
treeGenerator.add("redwood_medium", 1, (new GeneratorRedwoodTree.Builder()).log(BOPWoods.REDWOOD).leaves(BOPTrees.REDWOOD).minHeight(25).maxHeight(40).trunkWidth(2).create());
|
|
||||||
treeGenerator.add("oak_bush", 2, (new GeneratorBush.Builder()).amountPerChunk(3).maxHeight(2).create());
|
|
||||||
treeGenerator.add("oak_tree", 1, (new GeneratorBigTree.Builder()).amountPerChunk(1.0F).minHeight(4).maxHeight(10).foliageHeight(1).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).generationAttempts(64).create());
|
|
||||||
this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.25F).with(BOPPlants.SPROUT).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(4.0F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("fern", 8, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.FERN).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).generationAttempts(128).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("amber", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.AMBER).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
super.configure(conf);
|
|
||||||
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = conf.getBlockState("alternateTopBlock", this.alternateTopBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
|
|
||||||
{
|
|
||||||
this.topBlock = (noise + rand.nextDouble() * 3.0D > 1.5D) ? this.alternateTopBlock : this.usualTopBlock;
|
|
||||||
super.genTerrainBlocks(world, rand, primer, x, z, noise);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,102 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPFlowers;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLeaves;
|
|
||||||
import biomesoplenty.common.block.BlockBOPLilypad;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorLakes;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBush;
|
|
||||||
import net.minecraft.block.BlockDoublePlant;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockFlower.EnumFlowerType;
|
|
||||||
import net.minecraft.block.BlockOldLeaf;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.passive.EntityOcelot;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class BiomeGenSacredSprings extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenSacredSprings()
|
|
||||||
{
|
|
||||||
super("sacred_springs", new PropsBuilder("Sacred Springs").withGuiColour(39259).withTemperature(0.85F).withRainfall(0.9F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(64).heightVariation(10, 10);
|
|
||||||
|
|
||||||
this.canSpawnInBiome = false;
|
|
||||||
this.canGenerateRivers = false;
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
this.beachBiomeLocation = null;
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.TROPICAL, 1);
|
|
||||||
|
|
||||||
this.spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1));
|
|
||||||
|
|
||||||
// hot springs
|
|
||||||
this.addGenerator("hot_springs", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.5F).liquid(BOPBlocks.hot_spring_water).frozenLiquid((IBlockState)null).create());
|
|
||||||
|
|
||||||
// trees
|
|
||||||
this.addGenerator("sacred_oak_trees", GeneratorStage.POST, (new GeneratorBigTree.Builder()).amountPerChunk(0.4F).log(BOPWoods.SACRED_OAK).leaves(BlockBOPLeaves.paging.getVariantState(BOPTrees.SACRED_OAK).withProperty(BlockOldLeaf.DECAYABLE, Boolean.valueOf(false))).minHeight(35).maxHeight(40).trunkWidth(2).foliageDensity(2.0D).create());
|
|
||||||
this.addGenerator("leaves_clusters", GeneratorStage.TREE, (new GeneratorBush.Builder()).amountPerChunk(12.5F).maxHeight(2).create());
|
|
||||||
this.addGenerator("large_oak", GeneratorStage.TREE, (new GeneratorBigTree.Builder()).amountPerChunk(3.0F).altLeaves(BlockBOPLeaves.paging.getVariantState(BOPTrees.FLOWERING).withProperty(BlockOldLeaf.CHECK_DECAY, Boolean.valueOf(false))).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(2.75F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 2, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.15F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("pink_daffodil", 3, (new GeneratorFlora.Builder().with(BOPFlowers.PINK_DAFFODIL).create()));
|
|
||||||
flowerGenerator.add("poppy", 2, (new GeneratorFlora.Builder().with(EnumFlowerType.POPPY).create()));
|
|
||||||
flowerGenerator.add("paeonias", 1, (new GeneratorDoubleFlora.Builder()).with(BlockDoublePlant.EnumPlantType.PAEONIA).create());
|
|
||||||
flowerGenerator.add("oxeye_daisy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.OXEYE_DAISY).create()));
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(2.5F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).create());
|
|
||||||
this.addGenerator("rafflesia", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.RAFFLESIA).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(Blocks.WATERLILY.getDefaultState()).create());
|
|
||||||
this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BlockBOPLilypad.LilypadType.MEDIUM).create());
|
|
||||||
this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.SMALL).create());
|
|
||||||
this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.TINY).create());
|
|
||||||
this.addGenerator("flower_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.45F).with(BlockBOPLilypad.LilypadType.FLOWER).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("topaz", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TOPAZ).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(39285);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(39285);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,104 +0,0 @@
|
||||||
package biomesoplenty.common.biome.overworld;
|
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPDoublePlant;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorDoubleFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBasicTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBigTree;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockPlanks;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.entity.passive.EntityWolf;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class BiomeGenSeasonalForest extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public BiomeGenSeasonalForest()
|
|
||||||
{
|
|
||||||
super("seasonal_forest", new PropsBuilder("Seasonal Forest").withGuiColour(0xBEC44C).withTemperature(0.4F).withRainfall(0.8F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(75).heightVariation(20, 30);
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.COOL_TEMPERATE, 7);
|
|
||||||
|
|
||||||
this.canGenerateVillages = true;
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4));
|
|
||||||
|
|
||||||
// sand
|
|
||||||
this.addGenerator("sand", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(3).maxRadius(7).with(Blocks.SAND.getDefaultState()).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(10);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("large_oak", 1, (new GeneratorBigTree.Builder()).log(BlockPlanks.EnumType.OAK).leaves(BlockPlanks.EnumType.OAK).create());
|
|
||||||
treeGenerator.add("yellow_autumn", 4, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.BIRCH).leaves(BOPTrees.YELLOW_AUTUMN).minHeight(5).maxHeight(8).create());
|
|
||||||
treeGenerator.add("maple", 4, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.OAK).leaves(BOPTrees.MAPLE).minHeight(5).maxHeight(8).create());
|
|
||||||
treeGenerator.add("orange_autumn", 5, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.DARK_OAK).leaves(BOPTrees.ORANGE_AUTUMN).minHeight(5).maxHeight(8).create());
|
|
||||||
treeGenerator.add("dying_tree", 2, (new GeneratorBigTree.Builder()).minHeight(5).maxHeight(12).foliageHeight(2).leaves(BOPTrees.DEAD).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.4F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.4F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.3F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).generationAttempts(64).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(2.5F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
this.addGenerator("flax", GeneratorStage.FLOWERS, (new GeneratorDoubleFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPDoublePlant.DoublePlantType.FLAX).create());
|
|
||||||
this.addGenerator("poison_ivy", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BOPPlants.POISONIVY).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("flat_mushroom", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.FLAT_MUSHROOM).create());
|
|
||||||
this.addGenerator("toadstools", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.TOADSTOOL).create());
|
|
||||||
this.addGenerator("blue_milk_caps", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.BLUE_MILK_CAP).create());
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(2.0F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("amber", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.AMBER).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0xB5B952);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0xA3A627);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,138 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright 2015-2016, 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 java.util.Random;
|
|
||||||
|
|
||||||
import biomesoplenty.api.biome.BOPBiomes;
|
|
||||||
import biomesoplenty.api.block.BOPBlocks;
|
|
||||||
import biomesoplenty.api.block.BlockQueries;
|
|
||||||
import biomesoplenty.api.config.IConfigObj;
|
|
||||||
import biomesoplenty.api.enums.BOPClimates;
|
|
||||||
import biomesoplenty.api.enums.BOPGems;
|
|
||||||
import biomesoplenty.api.enums.BOPPlants;
|
|
||||||
import biomesoplenty.api.enums.BOPTrees;
|
|
||||||
import biomesoplenty.api.enums.BOPWoods;
|
|
||||||
import biomesoplenty.api.generation.GeneratorStage;
|
|
||||||
import biomesoplenty.common.block.BlockBOPCoral;
|
|
||||||
import biomesoplenty.common.block.BlockBOPMushroom;
|
|
||||||
import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorFlora;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorGrass;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorOreSingle;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWaterside;
|
|
||||||
import biomesoplenty.common.world.generator.GeneratorWeighted;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorBush;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorPineTree;
|
|
||||||
import biomesoplenty.common.world.generator.tree.GeneratorTaigaTree;
|
|
||||||
import net.minecraft.block.BlockFlower;
|
|
||||||
import net.minecraft.block.BlockTallGrass;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.init.Blocks;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
|
||||||
|
|
||||||
public class BiomeGenShield extends BOPOverworldBiome
|
|
||||||
{
|
|
||||||
public IBlockState usualTopBlock;
|
|
||||||
public IBlockState alternateTopBlock;
|
|
||||||
|
|
||||||
public BiomeGenShield()
|
|
||||||
{
|
|
||||||
super("shield", new PropsBuilder("Shield").withGuiColour(0x647F38).withTemperature(0.4F).withRainfall(0.8F));
|
|
||||||
|
|
||||||
// terrain
|
|
||||||
this.terrainSettings.avgHeight(63).heightVariation(10, 10).sidewaysNoise(0.1D).octaves(1, 4, 3, 1, 1, 0);
|
|
||||||
|
|
||||||
this.topBlock = Blocks.GRASS.getDefaultState();
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = Blocks.STONE.getDefaultState();
|
|
||||||
|
|
||||||
this.canGenerateVillages = false;
|
|
||||||
|
|
||||||
if (BOPBiomes.gravel_beach.isPresent())
|
|
||||||
{
|
|
||||||
this.beachBiomeLocation = ((BOPOverworldBiome)BOPBiomes.gravel_beach.get()).getResourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addWeight(BOPClimates.BOREAL, 5);
|
|
||||||
|
|
||||||
// gravel
|
|
||||||
this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(12).maxRadius(7).with(Blocks.GRAVEL.getDefaultState()).create());
|
|
||||||
|
|
||||||
// grasses
|
|
||||||
GeneratorWeighted grassGenerator = new GeneratorWeighted(1.2F);
|
|
||||||
this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator);
|
|
||||||
grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create());
|
|
||||||
grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create());
|
|
||||||
grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).create());
|
|
||||||
//grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create());
|
|
||||||
|
|
||||||
// trees & logs
|
|
||||||
GeneratorWeighted treeGenerator = new GeneratorWeighted(9);
|
|
||||||
this.addGenerator("trees", GeneratorStage.TREE, treeGenerator);
|
|
||||||
treeGenerator.add("spruce", 4, (new GeneratorTaigaTree.Builder()).maxHeight(13).create()); // TODO: implement pine cones
|
|
||||||
treeGenerator.add("oak_bush", 3, (new GeneratorBush.Builder()).maxHeight(2).create());
|
|
||||||
treeGenerator.add("pine", 2, (new GeneratorPineTree.Builder()).minHeight(6).maxHeight(18).log(BOPWoods.PINE).leaves(BOPTrees.PINE).create());
|
|
||||||
|
|
||||||
// flowers
|
|
||||||
GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.5F);
|
|
||||||
this.addGenerator("flowers", GeneratorStage.FLOWERS, flowerGenerator);
|
|
||||||
flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create()));
|
|
||||||
flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create()));
|
|
||||||
|
|
||||||
// other plants
|
|
||||||
//this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create());
|
|
||||||
this.addGenerator("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).placeOn(BlockQueries.fertile).with(BOPPlants.LEAFPILE).create());
|
|
||||||
this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.5F).placeOn(BlockQueries.fertile).with(BOPPlants.DEADLEAFPILE).create());
|
|
||||||
|
|
||||||
// shrooms
|
|
||||||
this.addGenerator("flat_mushroom", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.FLAT_MUSHROOM).create());
|
|
||||||
this.addGenerator("toadstools", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).generationAttempts(16).with(BlockBOPMushroom.MushroomType.TOADSTOOL).create());
|
|
||||||
this.addGenerator("brown_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).generationAttempts(16).with(Blocks.BROWN_MUSHROOM.getDefaultState()).create());
|
|
||||||
this.addGenerator("red_mushrooms", GeneratorStage.SHROOM,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).generationAttempts(16).with(Blocks.RED_MUSHROOM.getDefaultState()).create());
|
|
||||||
|
|
||||||
// water plants
|
|
||||||
this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).replace(Blocks.WATER).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create());
|
|
||||||
this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(1.4F).with(BOPPlants.REED).generationAttempts(32).create());
|
|
||||||
|
|
||||||
// gem
|
|
||||||
this.addGenerator("amber", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.AMBER).create());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void configure(IConfigObj conf)
|
|
||||||
{
|
|
||||||
super.configure(conf);
|
|
||||||
|
|
||||||
this.usualTopBlock = this.topBlock;
|
|
||||||
this.alternateTopBlock = conf.getBlockState("alternateTopBlock", this.alternateTopBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise)
|
|
||||||
{
|
|
||||||
this.topBlock = (noise + rand.nextDouble() * 1.0D > 1.8D) ? this.alternateTopBlock : this.usualTopBlock;
|
|
||||||
super.genTerrainBlocks(world, rand, primer, x, z, noise);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getGrassColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeGrassColor(0x7C9B45);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFoliageColorAtPos(BlockPos pos)
|
|
||||||
{
|
|
||||||
return getModdedBiomeFoliageColor(0x8EAF4F);
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue