World type configuration now supports biome extensions

This commit is contained in:
Adubbz 2016-02-01 19:56:10 +11:00
parent 9156ab8997
commit 2c85a16a6f
5 changed files with 16 additions and 7 deletions

View file

@ -74,10 +74,8 @@ public class BOPBiome extends BiomeGenBase implements IExtendedBiome
this.addGenerator("roots", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(4.0F).with(BOPPlants.ROOT).create());
}
public void applySettings(BOPWorldSettings settings)
{
}
@Override
public void applySettings(BOPWorldSettings settings){}
@Override
public void configure(IConfigObj conf)

View file

@ -9,6 +9,7 @@ import biomesoplenty.api.biome.generation.IGenerator;
import biomesoplenty.common.enums.BOPClimates;
import biomesoplenty.common.enums.BOPPlants;
import biomesoplenty.common.util.config.BOPConfig.IConfigObj;
import biomesoplenty.common.world.BOPWorldSettings;
import biomesoplenty.common.world.feature.GeneratorFlora;
import net.minecraft.world.biome.BiomeGenBase;
@ -26,6 +27,9 @@ public class ExtendedBiomeWrapper implements IExtendedBiome
this.addGenerator("roots", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(4.0F).with(BOPPlants.ROOT).create());
}
@Override
public void applySettings(BOPWorldSettings settings){}
@Override
public void configure(IConfigObj conf)
{

View file

@ -15,10 +15,12 @@ import biomesoplenty.api.biome.generation.GeneratorStage;
import biomesoplenty.api.biome.generation.IGenerator;
import biomesoplenty.common.enums.BOPClimates;
import biomesoplenty.common.util.config.BOPConfig.IConfigObj;
import biomesoplenty.common.world.BOPWorldSettings;
import net.minecraft.world.biome.BiomeGenBase;
public interface IExtendedBiome
{
public void applySettings(BOPWorldSettings settings);
public void configure(IConfigObj conf);
public BiomeOwner getBiomeOwner();

View file

@ -510,6 +510,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
}
}
//No extension exists
return null;
}

View file

@ -11,6 +11,8 @@ package biomesoplenty.common.world;
import java.util.List;
import biomesoplenty.api.biome.BOPBiome;
import biomesoplenty.api.biome.BOPBiomes;
import biomesoplenty.api.biome.IExtendedBiome;
import biomesoplenty.common.world.BOPWorldSettings.LandMassScheme;
import biomesoplenty.common.world.layer.GenLayerBiomeBOP;
import biomesoplenty.common.world.layer.GenLayerBiomeEdgeBOP;
@ -66,10 +68,12 @@ public class WorldChunkManagerBOP extends WorldChunkManager
// loop through the biomes and apply the settings
for (BiomeGenBase biome : BiomeGenBase.getBiomeGenArray())
{
if (biome == null) {continue;}
if (biome instanceof BOPBiome)
IExtendedBiome extBiome = BOPBiomes.REG_INSTANCE.getExtendedBiome(biome);
if (extBiome == null) {continue;}
else
{
((BOPBiome)biome).applySettings(settings);
extBiome.applySettings(settings);
}
}