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>
  • Field Details

  • 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 a Definition record class.
      Parameters:
      target - the value for the target record component
      textureReplacements - the value for the textureReplacements record component
      sounds - the value for the sounds record component
      spawnConditions - the value for the spawnConditions record component
      spawnChance - the value for the spawnChance record component
      attributes - the value for the attributes record component
      attackEffects - the value for the attackEffects record component
      burnInDaylight - the value for the burnInDaylight record component
      lootTable - the value for the lootTable record 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:
      selectors in interface net.minecraft.world.entity.variant.PriorityProvider<net.minecraft.world.entity.variant.SpawnContext, net.minecraft.world.entity.variant.SpawnCondition>
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • target

      public Optional<net.minecraft.resources.Identifier> target()
      Returns the value of the target record component.
      Returns:
      the value of the target record component
    • textureReplacements

      public List<MobVariants.TextureReplacement> textureReplacements()
      Returns the value of the textureReplacements record component.
      Returns:
      the value of the textureReplacements record component
    • sounds

      public MobVariants.Sounds sounds()
      Returns the value of the sounds record component.
      Returns:
      the value of the sounds record component
    • spawnConditions

      public net.minecraft.world.entity.variant.SpawnPrioritySelectors spawnConditions()
      Returns the value of the spawnConditions record component.
      Returns:
      the value of the spawnConditions record component
    • spawnChance

      public float spawnChance()
      Returns the value of the spawnChance record component.
      Returns:
      the value of the spawnChance record component
    • attributes

      public List<MobVariants.AttributeEntry> attributes()
      Returns the value of the attributes record component.
      Returns:
      the value of the attributes record component
    • attackEffects

      public List<net.minecraft.world.effect.MobEffectInstance> attackEffects()
      Returns the value of the attackEffects record component.
      Returns:
      the value of the attackEffects record component
    • burnInDaylight

      public Optional<Boolean> burnInDaylight()
      Returns the value of the burnInDaylight record component.
      Returns:
      the value of the burnInDaylight record component
    • lootTable

      public Optional<net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable>> lootTable()
      Returns the value of the lootTable record component.
      Returns:
      the value of the lootTable record component