Record Class MobVariants.Definition
java.lang.Object
java.lang.Record
net.rebel459.unified.impl.data.helper.MobVariants.Definition
- All Implemented Interfaces:
net.minecraft.world.entity.variant.PriorityProvider<net.minecraft.world.entity.variant.SpawnContext, net.minecraft.world.entity.variant.SpawnCondition>
- Enclosing class:
MobVariants
public static record MobVariants.Definition(Optional<net.minecraft.resources.Identifier> target, List<MobVariants.TextureReplacement> textureReplacements, MobVariants.Sounds sounds, net.minecraft.world.entity.variant.SpawnPrioritySelectors spawnConditions, float spawnChance, List<MobVariants.AttributeEntry> attributes, List<net.minecraft.world.effect.MobEffectInstance> attackEffects, Optional<Boolean> burnInDaylight, Optional<net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>> lootTable)
extends Record
implements net.minecraft.world.entity.variant.PriorityProvider<net.minecraft.world.entity.variant.SpawnContext, net.minecraft.world.entity.variant.SpawnCondition>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.entity.variant.PriorityProvider
net.minecraft.world.entity.variant.PriorityProvider.Selector<Context, Condition>, net.minecraft.world.entity.variant.PriorityProvider.SelectorCondition<C>, net.minecraft.world.entity.variant.PriorityProvider.UnpackedEntry<C,T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<MobVariants.Definition> static final MobVariants.Definitionstatic final com.mojang.serialization.Codec<MobVariants.Definition> static final com.mojang.serialization.MapCodec<MobVariants.Definition> static final com.mojang.serialization.Codec<net.minecraft.core.Holder<MobVariants.Definition>> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, Optional<net.minecraft.core.Holder<MobVariants.Definition>>> -
Constructor Summary
ConstructorsConstructorDescriptionDefinition(Optional<net.minecraft.resources.Identifier> target, List<MobVariants.TextureReplacement> textureReplacements, MobVariants.Sounds sounds, net.minecraft.world.entity.variant.SpawnPrioritySelectors spawnConditions, float spawnChance, List<MobVariants.AttributeEntry> attributes, List<net.minecraft.world.effect.MobEffectInstance> attackEffects, Optional<Boolean> burnInDaylight, Optional<net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>> lootTable) Creates an instance of aDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<net.minecraft.world.effect.MobEffectInstance> Returns the value of theattackEffectsrecord component.Returns the value of theattributesrecord component.Returns the value of theburnInDaylightrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Optional<net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>> Returns the value of thelootTablerecord component.List<net.minecraft.world.entity.variant.PriorityProvider.Selector<net.minecraft.world.entity.variant.SpawnContext, net.minecraft.world.entity.variant.SpawnCondition>> sounds()Returns the value of thesoundsrecord component.floatReturns the value of thespawnChancerecord component.net.minecraft.world.entity.variant.SpawnPrioritySelectorsReturns the value of thespawnConditionsrecord component.Optional<net.minecraft.resources.Identifier> target()Returns the value of thetargetrecord component.Returns the value of thetextureReplacementsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
EMPTY
-
PROPERTIES_CODEC
-
NETWORK_CODEC
-
REGISTRY_CODEC
public static final com.mojang.serialization.Codec<net.minecraft.core.Holder<MobVariants.Definition>> REGISTRY_CODEC -
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, Optional<net.minecraft.core.Holder<MobVariants.Definition>>> STREAM_CODEC
-
-
Constructor Details
-
Definition
public Definition(Optional<net.minecraft.resources.Identifier> target, List<MobVariants.TextureReplacement> textureReplacements, MobVariants.Sounds sounds, net.minecraft.world.entity.variant.SpawnPrioritySelectors spawnConditions, float spawnChance, List<MobVariants.AttributeEntry> attributes, List<net.minecraft.world.effect.MobEffectInstance> attackEffects, Optional<Boolean> burnInDaylight, Optional<net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>> lootTable) Creates an instance of aDefinitionrecord class.- Parameters:
target- the value for thetargetrecord componenttextureReplacements- the value for thetextureReplacementsrecord componentsounds- the value for thesoundsrecord componentspawnConditions- the value for thespawnConditionsrecord componentspawnChance- the value for thespawnChancerecord componentattributes- the value for theattributesrecord componentattackEffects- the value for theattackEffectsrecord componentburnInDaylight- the value for theburnInDaylightrecord componentlootTable- the value for thelootTablerecord component
-
-
Method Details
-
selectors
public List<net.minecraft.world.entity.variant.PriorityProvider.Selector<net.minecraft.world.entity.variant.SpawnContext, net.minecraft.world.entity.variant.SpawnCondition>> selectors()- Specified by:
selectorsin interfacenet.minecraft.world.entity.variant.PriorityProvider<net.minecraft.world.entity.variant.SpawnContext, net.minecraft.world.entity.variant.SpawnCondition>
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
textureReplacements
Returns the value of thetextureReplacementsrecord component.- Returns:
- the value of the
textureReplacementsrecord component
-
sounds
Returns the value of thesoundsrecord component.- Returns:
- the value of the
soundsrecord component
-
spawnConditions
public net.minecraft.world.entity.variant.SpawnPrioritySelectors spawnConditions()Returns the value of thespawnConditionsrecord component.- Returns:
- the value of the
spawnConditionsrecord component
-
spawnChance
public float spawnChance()Returns the value of thespawnChancerecord component.- Returns:
- the value of the
spawnChancerecord component
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-
attackEffects
Returns the value of theattackEffectsrecord component.- Returns:
- the value of the
attackEffectsrecord component
-
burnInDaylight
-
lootTable
public Optional<net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>> lootTable()Returns the value of thelootTablerecord component.- Returns:
- the value of the
lootTablerecord component
-