org.spongepowered.api.world.biome.BiomeAttributes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spongeapi Show documentation
Show all versions of spongeapi Show documentation
A plugin API for Minecraft: Java Edition
The newest version!
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.api.world.biome;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.registry.RegistryReference;
import org.spongepowered.api.util.Range;
import java.util.Optional;
/**
* Attributes with which biomes are picked for during world generation.
*/
public interface BiomeAttributes {
static BiomeAttributes point(final float temperature, final float humidity, final float continentalness, final float erosion, final float depth, final float weirdness, final float offset) {
return Sponge.game().factoryProvider().provide(Factory.class).ofPoint(temperature, humidity, continentalness, erosion, depth, weirdness, offset);
}
static BiomeAttributes range(final Range temperature, final Range humidity, final Range continentalness, final Range erosion, final Range depth, final Range weirdness, final float offset) {
return Sponge.game().factoryProvider().provide(Factory.class).ofRange(temperature, humidity, continentalness, erosion, depth, weirdness, offset);
}
static Optional defaultAttributes(RegistryReference biome) {
return Sponge.game().factoryProvider().provide(Factory.class).defaultAttributes(biome);
}
/**
* The temperature range.
*
* In Vanilla Minecraft, this is capped between {@code -2} to {@code 2}.
*
* @return temperature
*/
Range temperature();
/**
* The humidity range.
*
* In Vanilla Minecraft, this is capped between {@code -2} to {@code 2}.
*
* @return humidity
*/
Range humidity();
/**
* The continentalness.
* Higher value when more inland. For low values oceans may generate.
*
* @return continentalness
*/
Range continentalness();
/**
* The erosion.
* Higher values result in flatter areas, low values result in mountainous areas.
*
* @return erosion
*/
Range erosion();
/**
* The depth.
*
* @return the depth.
*/
Range depth();
/**
* Gets the weirdness.
*
* In Vanilla Minecraft, this is capped between {@code -2} to {@code 2}.
*
* @return weirdness
*/
Range weirdness();
/**
* The offset.
*
* In Vanilla Minecraft, this is capped between {@code 0} to {@code 1}.
*
* @return offset
*/
float offset();
interface Factory {
/**
* Returns the full range for {@link BiomeAttributes} settings.
*
* @return The full range
*/
Range fullRange();
/**
* Creates {@link BiomeAttributes} with point values.
*
* @return A biome attributes point
*/
BiomeAttributes ofPoint(float temperature, float humidity, float continentalness, float erosion, float depth, float weirdness, float offset);
/**
* Creates {@link BiomeAttributes} spanning a range of values.
*
* @return A biome attributes range
*/
BiomeAttributes ofRange(Range temperature, Range humidity, Range continentalness, Range erosion, Range depth, Range weirdness, float offset);
/**
* Returns the default {@link BiomeAttributes} used in vanilla biomes.
*
* @param biome The biome attributes
*
* @return The biome attributes
*/
Optional defaultAttributes(RegistryReference biome);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy