Package forestry.api.apiculture.genetics
Interface IBeeEffect
- All Superinterfaces:
IEffect
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<IBeeEffect> Dispatch codec for datapack effect definitions (data/<namespace>/forestry/bee_effect/<name>.json). -
Method Summary
Modifier and TypeMethodDescriptiondefault com.mojang.serialization.MapCodec<? extends IBeeEffect> codec()default IEffectDatadoEffect(IGenome genome, IEffectData storedData, IBeeHousing housing) Called by apiaries to cause an effect in the world.default IEffectDatadoFX(IGenome genome, IEffectData storedData, IBeeHousing housing) Called on the client side to produce visual bee effects.default booleanbooleandefault IEffectDatavalidateStorage(IEffectData storedData) Returns the passed data storage if it is valid for this effect or a new one if the passed storage object was invalid for this effect.
-
Field Details
-
CODEC
Dispatch codec for datapack effect definitions (data/<namespace>/forestry/bee_effect/<name>.json). The"type"field is resolved againstForestryRegistries.BEE_EFFECT_TYPEto a parameterized primitive (apply_potion, transform_block, …). Effects are always type-keyed, so there is no plain fallback (mirrorsIMutationCondition#CODEC). The reloadableBeeEffectManagerdecodes each entry with this codec and, viaGeneticsReloadHandler, feeds the results into the bee species type's effect map before species are (re)built, so a species genome can reference a datapack effect allele by its entry key.
-
-
Method Details
-
codec
- Returns:
- The serializer used to (de)serialize this effect in a datapack effect definition. Only primitives that are meant to be datapack-configurable override this; code-only base effects never pass through the datapack registry, so they inherit the throwing default.
-
isDominant
boolean isDominant()- Returns:
- Whether the allele for this value is dominant or recessive.
-
validateStorage
Description copied from interface:IEffectReturns the passed data storage if it is valid for this effect or a new one if the passed storage object was invalid for this effect.- Specified by:
validateStoragein interfaceIEffect- Returns:
IEffectDatafor the next cycle.
-
isCombinable
default boolean isCombinable()- Specified by:
isCombinablein interfaceIEffect- Returns:
- Whether this effect can work with another combinable effect on the same chromosome pair.
-
doEffect
Called by apiaries to cause an effect in the world. (server)- Parameters:
genome- Genome of the bee queen causing this effectstoredData- Object containing the stored effect data for the apiary/hive the bee is in.housing-IBeeHousingthe bee currently resides in.- Returns:
- storedData, may have been manipulated.
-
doFX
Called on the client side to produce visual bee effects.- Parameters:
genome- Genome of the bee queen causing this effectstoredData- Object containing the stored effect data for the apiary/hive the bee is in.housing-IBeeHousingthe bee currently resides in.- Returns:
- storedData, may have been manipulated.
-