JavaScript is disabled on your browser.
Method Summary
All Methods Instance Methods Abstract Methods
net.minecraft.data.DataProvider
Creates a data provider that generates butterfly species JSON.
getBreedingTracker (net.minecraft.world.level.LevelAccessor level,
com.mojang.authlib.GameProfile profile)
Gets the player's breeding tracker for this species type.
getCocoon (net.minecraft.resources.ResourceLocation id)
boolean
isMated (net.minecraft.world.item.ItemStack stack)
net.minecraft.core.BlockPos
plantCocoon (net.minecraft.world.level.LevelAccessor level,
net.minecraft.core.BlockPos pos,
IButterfly caterpillar,
int age,
boolean createNursery)
net.minecraft.world.entity.Mob
Spawns the given butterfly in the world.
Methods inherited from interface forestry.api.core.genetics.ISpeciesType
cast , createBreedingTracker , createBreedingTracker , createDefaultStack , createRandomIndividual , createStack , createStack , getAllSpecies , getAllSpeciesIds , getBreedingTrackerFile , getDefaultSpecies , getDefaultStage , getDisplayName , getIndividualCodec , getKaryotype , getLifeStage , getLifeStages , getMutations , getRandomSpecies , getResearchBounty , getResearchSuitability , getSpecies , getSpeciesCount , getSpeciesSafe , getTranslationKey , getTypeForMutation , handleSpeciesRegistration , id , initializeBreedingTracker , isMember , isMember , onSpeciesRegistered
Method Details
getBreedingTracker
IBreedingTracker getBreedingTracker (net.minecraft.world.level.LevelAccessor level,
@Nullable
com.mojang.authlib.GameProfile profile)
Gets the player's breeding tracker for this species type.
Specified by:
getBreedingTracker in interface ISpeciesType <IButterflySpecies ,IButterfly >
Parameters:
level - The world instance where the breeding tracker is stored.
profile - The player whose breeding tracker should be returned.
Returns:
The breeding tracker for species of this type.
getCocoon
Returns:
The cocoon registered with the given ID, throwing if none is registered. For internal/fail-fast callers
only; the cocoon reference chromosome itself resolves through getCocoonSafe(net.minecraft.resources.ResourceLocation) so a
datapack-authored species referencing an unregistered cocoon id can't crash saved/rendered butterflies.
getCocoonSafe
@Nullable
IButterflyCocoon getCocoonSafe (net.minecraft.resources.ResourceLocation id)
Returns:
The cocoon registered with the given ID, or null if none is registered (graceful fallback
variant; backs the cocoon reference chromosome).
getButterflyEffect
IButterflyEffect getButterflyEffect (net.minecraft.resources.ResourceLocation id)
Returns:
The butterfly effect registered with the given ID, throwing if none is registered. For internal/fail-fast
callers only; the butterfly_effect reference chromosome itself resolves through
getButterflyEffectSafe(net.minecraft.resources.ResourceLocation) so a datapack-authored species referencing an unregistered effect id can't
crash saved/rendered butterflies.
getButterflyEffectSafe
@Nullable
IButterflyEffect getButterflyEffectSafe (net.minecraft.resources.ResourceLocation id)
Returns:
The butterfly effect registered with the given ID, or null if none is registered (graceful
fallback variant; backs the butterfly_effect reference chromosome).
spawnButterflyInWorld
net.minecraft.world.entity.Mob spawnButterflyInWorld (net.minecraft.world.level.Level level,
IButterfly butterfly,
double x,
double y,
double z)
Spawns the given butterfly in the world.
Returns:
butterfly entity on success, null otherwise.
plantCocoon
@Nullable
net.minecraft.core.BlockPos plantCocoon (net.minecraft.world.level.LevelAccessor level,
net.minecraft.core.BlockPos pos,
IButterfly caterpillar,
int age,
boolean createNursery)
isMated
boolean isMated (net.minecraft.world.item.ItemStack stack)
Returns:
true if passed item is mated.
createSpeciesProvider
Creates a data provider that generates butterfly species JSON.
Parameters:
output - The pack output to generate into
registries - The registries used to encode the species
species - The action that registers the species to generate
Returns:
The data provider to add to the data generator