Record Class EntityTextureOverride<T extends net.minecraft.world.entity.LivingEntity>

java.lang.Object
java.lang.Record
net.frozenblock.lib.entity.api.rendering.EntityTextureOverride<T>
Type Parameters:
T - The entity class the override is for.

@Environment(CLIENT) public record EntityTextureOverride<T extends net.minecraft.world.entity.LivingEntity>(net.minecraft.world.entity.EntityType<T extends net.minecraft.world.entity.LivingEntity> type, net.minecraft.resources.ResourceLocation texture, EntityTextureOverride.Condition<T extends net.minecraft.world.entity.LivingEntity> condition) extends Record
Used to override an entity's texture if a condition is met.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    EntityTextureOverride.Condition<T extends net.minecraft.world.entity.LivingEntity>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    EntityTextureOverride(net.minecraft.world.entity.EntityType<T> type, net.minecraft.resources.ResourceLocation texture, EntityTextureOverride.Condition<T> condition)
    Creates an instance of a EntityTextureOverride record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the condition record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    static <T extends net.minecraft.world.entity.LivingEntity>
    EntityTextureOverride<T>
    register(net.minecraft.resources.ResourceLocation key, net.minecraft.world.entity.EntityType<T> type, net.minecraft.resources.ResourceLocation texture, boolean caseSensitive, String... names)
     
    static <T extends net.minecraft.world.entity.LivingEntity>
    EntityTextureOverride<T>
    register(net.minecraft.resources.ResourceLocation key, net.minecraft.world.entity.EntityType<T> type, net.minecraft.resources.ResourceLocation texture, String... names)
     
    static <T extends net.minecraft.world.entity.LivingEntity>
    EntityTextureOverride<T>
    register(net.minecraft.resources.ResourceLocation key, net.minecraft.world.entity.EntityType<T> type, net.minecraft.resources.ResourceLocation texture, EntityTextureOverride.Condition<T> condition)
     
    net.minecraft.resources.ResourceLocation
    Returns the value of the texture record component.
    final String
    Returns a string representation of this record class.
    net.minecraft.world.entity.EntityType<T>
    Returns the value of the type record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • EntityTextureOverride

      public EntityTextureOverride(net.minecraft.world.entity.EntityType<T> type, net.minecraft.resources.ResourceLocation texture, EntityTextureOverride.Condition<T> condition)
      Creates an instance of a EntityTextureOverride record class.
      Parameters:
      type - the value for the type record component
      texture - the value for the texture record component
      condition - the value for the condition record component
  • Method Details

    • register

      public static <T extends net.minecraft.world.entity.LivingEntity> EntityTextureOverride<T> register(net.minecraft.resources.ResourceLocation key, net.minecraft.world.entity.EntityType<T> type, net.minecraft.resources.ResourceLocation texture, String... names)
    • register

      public static <T extends net.minecraft.world.entity.LivingEntity> EntityTextureOverride<T> register(net.minecraft.resources.ResourceLocation key, net.minecraft.world.entity.EntityType<T> type, net.minecraft.resources.ResourceLocation texture, boolean caseSensitive, String... names)
    • register

      public static <T extends net.minecraft.world.entity.LivingEntity> EntityTextureOverride<T> register(net.minecraft.resources.ResourceLocation key, net.minecraft.world.entity.EntityType<T> type, net.minecraft.resources.ResourceLocation texture, EntityTextureOverride.Condition<T> condition)
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • type

      public net.minecraft.world.entity.EntityType<T> type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • texture

      public net.minecraft.resources.ResourceLocation texture()
      Returns the value of the texture record component.
      Returns:
      the value of the texture record component
    • condition

      public EntityTextureOverride.Condition<T> condition()
      Returns the value of the condition record component.
      Returns:
      the value of the condition record component