BiomesOPlenty/src/main/java/biomesoplenty/common/biome/BiomeBOP.java

57 lines
1.6 KiB
Java
Raw Normal View History

/*******************************************************************************
* Copyright 2014-2019, the Biomes O' Plenty Team
*
* This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License.
*
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
******************************************************************************/
package biomesoplenty.common.biome;
import biomesoplenty.api.enums.BOPClimates;
2019-05-24 04:22:06 +00:00
import net.minecraft.init.Biomes;
2019-05-24 04:03:39 +00:00
import net.minecraft.util.registry.IRegistry;
import net.minecraft.world.biome.Biome;
import java.util.HashMap;
import java.util.Map;
2019-05-24 04:03:39 +00:00
import java.util.Optional;
2019-01-15 13:51:55 +00:00
public class BiomeBOP extends Biome
{
protected Map<BOPClimates, Integer> weightMap = new HashMap<BOPClimates, Integer>();
public boolean canSpawnInBiome;
2019-05-24 04:22:06 +00:00
public int beachBiomeId = IRegistry.BIOME.getId(Biomes.BEACH);
2019-01-15 13:51:55 +00:00
public BiomeBOP(BiomeBuilder builder)
{
super(builder);
this.canSpawnInBiome = true;
}
public void addWeight(BOPClimates climate, int weight)
{
this.weightMap.put(climate, weight);
}
2019-05-24 04:03:39 +00:00
public void setBeachBiome(Optional<Biome> biome)
{
if (biome.isPresent())
this.beachBiomeId = IRegistry.BIOME.getId(biome.get());
else
this.beachBiomeId = -1;
2019-05-24 04:03:39 +00:00
}
public void setBeachBiome(Biome biome)
{
if (biome != null)
this.beachBiomeId = IRegistry.BIOME.getId(biome);
else
this.beachBiomeId = -1;
2019-05-24 04:03:39 +00:00
}
public Map<BOPClimates, Integer> getWeightMap()
{
return this.weightMap;
}
}