Interface IEnvironmentalAffinityAPI
- All Known Implementing Classes:
EnvironmentalAffinityAPI
public interface IEnvironmentalAffinityAPI
An API providing a means of interacting with the environment and registering how affine those environments are to Light or Decay.
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableMap<net.minecraft.resources.ResourceLocation,
EnvironmentalAffinity> Returns all bindings from biome to their environmental affinity.getBiomeEnvEffects
(net.minecraft.resources.ResourceLocation biome) Returns the environmental affinity of this biome with respect to Decay vs Light.boolean
MUST BE CHECKED BEFORE OTHER METHODS ARE USED.void
setBiomeEnvEffects
(net.minecraft.resources.ResourceLocation biome, EnvironmentalAffinity affinity) Sets the environmental affinity of the given biome.
-
Method Details
-
isInstalled
boolean isInstalled()MUST BE CHECKED BEFORE OTHER METHODS ARE USED.- Returns:
- Whether or not the API is installed.
-
getBiomeEnvEffects
@Nullable EnvironmentalAffinity getBiomeEnvEffects(net.minecraft.resources.ResourceLocation biome) throws ArgumentNullException, IllegalStateException Returns the environmental affinity of this biome with respect to Decay vs Light.- Parameters:
biome
- The biome's registry name.- Returns:
- The environmental affinity of this biome, or null if no affinity was registered.
- Throws:
ArgumentNullException
- If the biome parameter is null.IllegalStateException
- If the mod is not installed.
-
setBiomeEnvEffects
void setBiomeEnvEffects(net.minecraft.resources.ResourceLocation biome, @Nullable EnvironmentalAffinity affinity) throws ArgumentNullException, IllegalStateException Sets the environmental affinity of the given biome. If this biome has already been registered, it will overwrite the previous registered setting.- Parameters:
biome
- The biome to associate with, by registry name.affinity
- The affinity to use for this biome. This can be null to remove the affinity.- Throws:
ArgumentNullException
- If the biome parameter is null.IllegalStateException
- If the mod is not installed, or if this is called after the Forge load cycle has completed.
-
getAllBindings
com.google.common.collect.ImmutableMap<net.minecraft.resources.ResourceLocation,EnvironmentalAffinity> getAllBindings() throws IllegalStateExceptionReturns all bindings from biome to their environmental affinity.- Returns:
- All bindings from biome to their environmental affinity.
- Throws:
IllegalStateException
-