Prefix modid in weights config for standard biomes, fallback on Ocean for empty climates
This commit is contained in:
parent
9a8f7727b4
commit
aa943081e3
2 changed files with 11 additions and 4 deletions
|
@ -116,12 +116,17 @@ public enum BOPClimates
|
||||||
|
|
||||||
public ImmutableList<WeightedBiomeEntry> getLandBiomes()
|
public ImmutableList<WeightedBiomeEntry> getLandBiomes()
|
||||||
{
|
{
|
||||||
return ImmutableList.copyOf(this.landBiomes);
|
return this.landBiomes.isEmpty() ? ImmutableList.of(this.getDefaultWeightedBiomeEntry()) : ImmutableList.copyOf(this.landBiomes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImmutableList<WeightedBiomeEntry> getIslandBiomes()
|
public ImmutableList<WeightedBiomeEntry> getIslandBiomes()
|
||||||
{
|
{
|
||||||
return ImmutableList.copyOf(this.islandBiomes);
|
return this.islandBiomes.isEmpty() ? ImmutableList.of(this.getDefaultWeightedBiomeEntry()) : ImmutableList.copyOf(this.islandBiomes);
|
||||||
|
}
|
||||||
|
|
||||||
|
private WeightedBiomeEntry getDefaultWeightedBiomeEntry()
|
||||||
|
{
|
||||||
|
return new WeightedBiomeEntry(100, Biomes.OCEAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
|
|
@ -16,6 +16,7 @@ import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraftforge.common.BiomeManager;
|
import net.minecraftforge.common.BiomeManager;
|
||||||
|
@ -65,8 +66,9 @@ public class BiomeRegistry
|
||||||
// Ignore biomes which don't have any weights set by default
|
// Ignore biomes which don't have any weights set by default
|
||||||
if (!((BiomeBOP)regData.getBiome()).getWeightMap().isEmpty())
|
if (!((BiomeBOP)regData.getBiome()).getWeightMap().isEmpty())
|
||||||
{
|
{
|
||||||
defaultStandardBiomeWeights.put(registration.regData.getName(), registration.regData.getWeights());
|
String biomeName = new ResourceLocation(BiomesOPlenty.MOD_ID, regData.getName()).toString();
|
||||||
regDataMap.put(registration.regData.getName(), registration.regData);
|
defaultStandardBiomeWeights.put(biomeName, registration.regData.getWeights());
|
||||||
|
regDataMap.put(biomeName, registration.regData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue