Don't convert biomes already registered to a climate via our api
This commit is contained in:
parent
786d0416c3
commit
18946ec9ec
3 changed files with 29 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package biomesoplenty.api.enums;
|
package biomesoplenty.api.enums;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.biome.Biomes;
|
import net.minecraft.world.biome.Biomes;
|
||||||
|
@ -108,6 +109,16 @@ public enum BOPClimates
|
||||||
return (deep ? Biomes.DEEP_OCEAN : Biomes.OCEAN);
|
return (deep ? Biomes.DEEP_OCEAN : Biomes.OCEAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ImmutableList<WeightedBiomeEntry> getLandBiomes()
|
||||||
|
{
|
||||||
|
return ImmutableList.copyOf(this.landBiomes);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImmutableList<WeightedBiomeEntry> getIslandBiomes()
|
||||||
|
{
|
||||||
|
return ImmutableList.copyOf(this.islandBiomes);
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
// Set up vanilla biomes
|
// Set up vanilla biomes
|
||||||
|
|
|
@ -66,7 +66,6 @@ public class BiomesOPlenty
|
||||||
{
|
{
|
||||||
ModBiomes.setup();
|
ModBiomes.setup();
|
||||||
ModVanillaCompat.setup();
|
ModVanillaCompat.setup();
|
||||||
ModCompatibility.setup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clientSetup(final FMLClientSetupEvent event)
|
private void clientSetup(final FMLClientSetupEvent event)
|
||||||
|
@ -78,6 +77,7 @@ public class BiomesOPlenty
|
||||||
{
|
{
|
||||||
proxy.init();
|
proxy.init();
|
||||||
//GenLayerVisualizer.run();
|
//GenLayerVisualizer.run();
|
||||||
|
ModCompatibility.setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void serverStarting(FMLServerStartingEvent evt)
|
public void serverStarting(FMLServerStartingEvent evt)
|
||||||
|
|
|
@ -68,6 +68,23 @@ public class ModCompatibility
|
||||||
// TODO: Make this more accurate, possibly analyze heights, temps, rainfall and/or biome dictionary tags
|
// TODO: Make this more accurate, possibly analyze heights, temps, rainfall and/or biome dictionary tags
|
||||||
private static void remapBiomeToBoP(Biome biome, BiomeManager.BiomeType type, int weight)
|
private static void remapBiomeToBoP(Biome biome, BiomeManager.BiomeType type, int weight)
|
||||||
{
|
{
|
||||||
|
/* If any of our climates already have the biome (from a mod using our api), then skip this biome */
|
||||||
|
for (BOPClimates climate : BOPClimates.values())
|
||||||
|
{
|
||||||
|
List<BOPClimates.WeightedBiomeEntry> entries = Lists.newArrayList();
|
||||||
|
entries.addAll(climate.getLandBiomes());
|
||||||
|
entries.addAll(climate.getIslandBiomes());
|
||||||
|
|
||||||
|
for (BOPClimates.WeightedBiomeEntry entry : entries)
|
||||||
|
{
|
||||||
|
if (entry.biome == biome)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (BOPClimates climate : BOPClimates.values())
|
for (BOPClimates climate : BOPClimates.values())
|
||||||
{
|
{
|
||||||
if (climate.biomeType == type)
|
if (climate.biomeType == type)
|
||||||
|
|
Loading…
Reference in a new issue