use of org.spongepowered.api.world.biome.BiomeType in project Skree by Skelril.
the class NoOreWorldGeneratorModifier method modifyWorldGenerator.
@Override
public void modifyWorldGenerator(WorldProperties world, DataContainer settings, WorldGenerator worldGenerator) {
for (BiomeType biomeType : Sponge.getRegistry().getAllOf(BiomeType.class)) {
BiomeGenerationSettings biomeData = worldGenerator.getBiomeSettings(biomeType);
List<Ore> populators = biomeData.getPopulators(Ore.class);
biomeData.getPopulators().removeAll(populators);
}
}
use of org.spongepowered.api.world.biome.BiomeType in project SpongeCommon by SpongePowered.
the class BiomeTypeRegistryModule method registerAdditional.
@AdditionalRegistration
public void registerAdditional() {
for (Biome biome : Biome.REGISTRY) {
if (biome != null && !this.biomeTypes.contains(biome)) {
String id = ((BiomeType) biome).getId();
if (id == null) {
ResourceLocation reg_id = Biome.REGISTRY.getNameForObject(biome);
((IMixinBiome) biome).setModId(reg_id.getResourceDomain());
id = reg_id.toString();
((IMixinBiome) biome).setId(id);
}
this.biomeTypes.add((BiomeType) biome);
this.catalogTypeMap.put(id, (BiomeType) biome);
}
}
// Re-map fields in case mods have changed vanilla world types
RegistryHelper.mapFields(BiomeTypes.class, provideCatalogMap());
}
use of org.spongepowered.api.world.biome.BiomeType in project SpongeCommon by SpongePowered.
the class BiomeTypeRegistryModule method registerDefaults.
@Override
public void registerDefaults() {
for (Biome biome : Biome.REGISTRY) {
if (biome != null) {
String id = ((BiomeType) biome).getId();
if (id == null) {
ResourceLocation reg_id = Biome.REGISTRY.getNameForObject(biome);
((IMixinBiome) biome).setModId(reg_id.getResourceDomain());
id = reg_id.toString();
((IMixinBiome) biome).setId(id);
}
this.biomeTypes.add((BiomeType) biome);
this.catalogTypeMap.put(id, (BiomeType) biome);
}
}
}
use of org.spongepowered.api.world.biome.BiomeType in project SpongeCommon by SpongePowered.
the class ByteArrayMutableBiomeBuffer method getBiome.
@Override
public BiomeType getBiome(int x, int y, int z) {
checkOpen();
checkRange(x, y, z);
byte biomeId = this.biomes[getIndex(x, z)];
BiomeType biomeType = (BiomeType) Biome.getBiomeForId(biomeId & 255);
return biomeType == null ? BiomeTypes.OCEAN : biomeType;
}
use of org.spongepowered.api.world.biome.BiomeType in project SpongeCommon by SpongePowered.
the class ObjectArrayImmutableBiomeBuffer method getNativeBiome.
/**
* Gets the native biome for the position, resolving virtual biomes to
* persisted types if needed.
*
* @param x The X position
* @param y The Y position
* @param z The X position
* @return The native biome
*/
public Biome getNativeBiome(int x, int y, int z) {
checkRange(x, y, z);
BiomeType type = this.biomes[getIndex(x, z)];
if (type instanceof VirtualBiomeType) {
type = ((VirtualBiomeType) type).getPersistedType();
}
return (Biome) type;
}
Aggregations