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>(Class<? extends net.minecraft.client.renderer.entity.LivingEntityRenderer<?,?,?>> clazz, net.minecraft.resources.ResourceLocation texture, EntityTextureOverride.Condition condition)
extends Record
Used to override an entity's texture if a condition is met.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionEntityTextureOverride(Class<? extends net.minecraft.client.renderer.entity.LivingEntityRenderer<?, ?, ?>> clazz, net.minecraft.resources.ResourceLocation texture, EntityTextureOverride.Condition condition) Creates an instance of aEntityTextureOverriderecord class. -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends net.minecraft.client.renderer.entity.LivingEntityRenderer<?, ?, ?>> clazz()Returns the value of theclazzrecord component.Returns the value of theconditionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static <T extends net.minecraft.world.entity.LivingEntity>
@NotNull EntityTextureOverride<T> register(net.minecraft.resources.ResourceLocation key, Class<? extends net.minecraft.client.renderer.entity.LivingEntityRenderer<?, ?, ?>> clazz, net.minecraft.resources.ResourceLocation texture, boolean caseSensitive, String... names) Creates and registers anEntityTextureOverridebased on an entity's name.static <T extends net.minecraft.world.entity.LivingEntity>
@NotNull EntityTextureOverride<T> register(net.minecraft.resources.ResourceLocation key, Class<? extends net.minecraft.client.renderer.entity.LivingEntityRenderer<?, ?, ?>> clazz, net.minecraft.resources.ResourceLocation texture, String... names) Creates and registers anEntityTextureOverridebased on an entity's name, not-case-sensitive.static <T extends net.minecraft.world.entity.LivingEntity>
@NotNull EntityTextureOverride<T> register(net.minecraft.resources.ResourceLocation key, Class<? extends net.minecraft.client.renderer.entity.LivingEntityRenderer<?, ?, ?>> clazz, net.minecraft.resources.ResourceLocation texture, EntityTextureOverride.Condition condition) Creates and registers anEntityTextureOverride.net.minecraft.resources.ResourceLocationtexture()Returns the value of thetexturerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EntityTextureOverride
public EntityTextureOverride(Class<? extends net.minecraft.client.renderer.entity.LivingEntityRenderer<?, ?, ?>> clazz, net.minecraft.resources.ResourceLocation texture, EntityTextureOverride.Condition condition) Creates an instance of aEntityTextureOverriderecord class.- Parameters:
clazz- the value for theclazzrecord componenttexture- the value for thetexturerecord componentcondition- the value for theconditionrecord component
-
-
Method Details
-
register
@NotNull public static <T extends net.minecraft.world.entity.LivingEntity> @NotNull EntityTextureOverride<T> register(net.minecraft.resources.ResourceLocation key, Class<? extends net.minecraft.client.renderer.entity.LivingEntityRenderer<?, ?, ?>> clazz, net.minecraft.resources.ResourceLocation texture, String... names) Creates and registers anEntityTextureOverridebased on an entity's name, not-case-sensitive.- Parameters:
key- TheResourceLocationto register theEntityTextureOverrideto.clazz- TheLivingEntityRendererclass to register theEntityTextureOverridefor.texture- The texture to use while enabled.names- Names that will cause theEntityTextureOverrideto trigger.- Returns:
- The created
EntityTextureOverride.
-
register
@NotNull public static <T extends net.minecraft.world.entity.LivingEntity> @NotNull EntityTextureOverride<T> register(net.minecraft.resources.ResourceLocation key, Class<? extends net.minecraft.client.renderer.entity.LivingEntityRenderer<?, ?, ?>> clazz, net.minecraft.resources.ResourceLocation texture, boolean caseSensitive, String... names) Creates and registers anEntityTextureOverridebased on an entity's name.- Parameters:
key- TheResourceLocationto register theEntityTextureOverrideto.clazz- TheLivingEntityRendererclass to register theEntityTextureOverridefor.texture- The texture to use while enabled.caseSensitive- Whether the texture override checks for the same case in the entity's name.names- Names that will cause theEntityTextureOverrideto trigger.- Returns:
- The created
EntityTextureOverride.
-
register
@NotNull public static <T extends net.minecraft.world.entity.LivingEntity> @NotNull EntityTextureOverride<T> register(net.minecraft.resources.ResourceLocation key, Class<? extends net.minecraft.client.renderer.entity.LivingEntityRenderer<?, ?, ?>> clazz, net.minecraft.resources.ResourceLocation texture, EntityTextureOverride.Condition condition) Creates and registers anEntityTextureOverride.- Parameters:
key- TheResourceLocationto register theEntityTextureOverrideto.clazz- TheLivingEntityRendererclass to register theEntityTextureOverridefor.texture- The texture to use while enabled.condition- The conditions to be met in order to override the entity's texture.- Returns:
- The created
EntityTextureOverride.
-
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. -
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. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
clazz
Returns the value of theclazzrecord component.- Returns:
- the value of the
clazzrecord component
-
texture
public net.minecraft.resources.ResourceLocation texture()Returns the value of thetexturerecord component.- Returns:
- the value of the
texturerecord component
-
condition
Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-