@Environment(value=CLIENT) public final class ArmorRenderingRegistry extends Object
Item
, to be provided by a ArmorRenderingRegistry.ModelProvider
or ArmorRenderingRegistry.TextureProvider
.
This can be used to replace existing vanilla armor models and textures conditionally, however each Item
instance can only allow one ArmorRenderingRegistry.ModelProvider
or ArmorRenderingRegistry.TextureProvider
respectively, causing potential conflicts
with other mods if you replace the model or texture for vanilla items. Consider using a separate item instead.
A custom model would probably also require a custom texture to go along it, the model will use the vanilla texture if it is undefined.
Since armor textures identifier in vanilla is hardcoded to be in the minecraft
namespace, this registry can also be
used to use a custom namespace if desired.
Modifier and Type | Class and Description |
---|---|
static interface |
ArmorRenderingRegistry.ModelProvider |
static interface |
ArmorRenderingRegistry.TextureProvider |
Modifier and Type | Method and Description |
---|---|
static @NotNull net.minecraft.client.render.entity.model.BipedEntityModel<net.minecraft.entity.LivingEntity> |
getArmorModel(net.minecraft.entity.LivingEntity entity,
net.minecraft.item.ItemStack stack,
net.minecraft.entity.EquipmentSlot slot,
net.minecraft.client.render.entity.model.BipedEntityModel<net.minecraft.entity.LivingEntity> defaultModel)
Gets the model of the armor piece.
|
static @NotNull net.minecraft.util.Identifier |
getArmorTexture(net.minecraft.entity.LivingEntity entity,
net.minecraft.item.ItemStack stack,
net.minecraft.entity.EquipmentSlot slot,
boolean secondLayer,
@Nullable String suffix,
net.minecraft.util.Identifier defaultTexture)
Gets the armor texture
Identifier . |
static void |
registerModel(@Nullable ArmorRenderingRegistry.ModelProvider provider,
net.minecraft.item.Item... items)
Registers a provider for custom armor models for an item.
|
static void |
registerModel(@Nullable ArmorRenderingRegistry.ModelProvider provider,
Iterable<net.minecraft.item.Item> items)
Registers a provider for custom armor models for an item.
|
static void |
registerSimpleTexture(net.minecraft.util.Identifier identifier,
net.minecraft.item.Item... items)
Register simple armor items to use the vanilla armor file name under the mods namespace.
|
static void |
registerTexture(@Nullable ArmorRenderingRegistry.TextureProvider provider,
net.minecraft.item.Item... items)
Registers a provider for custom texture models for an item.
|
static void |
registerTexture(@Nullable ArmorRenderingRegistry.TextureProvider provider,
Iterable<net.minecraft.item.Item> items)
Registers a provider for custom texture models for an item.
|
public static void registerModel(@Nullable @Nullable ArmorRenderingRegistry.ModelProvider provider, net.minecraft.item.Item... items)
provider
- the provider for the modelitems
- the items to be registered forpublic static void registerModel(@Nullable @Nullable ArmorRenderingRegistry.ModelProvider provider, Iterable<net.minecraft.item.Item> items)
provider
- the provider for the modelitems
- the items to be registered forpublic static void registerTexture(@Nullable @Nullable ArmorRenderingRegistry.TextureProvider provider, net.minecraft.item.Item... items)
provider
- the provider for the textureitems
- the items to be registered forpublic static void registerTexture(@Nullable @Nullable ArmorRenderingRegistry.TextureProvider provider, Iterable<net.minecraft.item.Item> items)
provider
- the provider for the textureitems
- the items to be registered forpublic static void registerSimpleTexture(net.minecraft.util.Identifier identifier, net.minecraft.item.Item... items)
identifier
- The namespace + path to use for the armor texture location.items
- the items to be registered@NotNull public static @NotNull net.minecraft.client.render.entity.model.BipedEntityModel<net.minecraft.entity.LivingEntity> getArmorModel(net.minecraft.entity.LivingEntity entity, net.minecraft.item.ItemStack stack, net.minecraft.entity.EquipmentSlot slot, net.minecraft.client.render.entity.model.BipedEntityModel<net.minecraft.entity.LivingEntity> defaultModel)
entity
- The entity equipping the armorstack
- The item stack of the armorslot
- The slot which the armor is indefaultModel
- The default model that vanilla provides@NotNull public static @NotNull net.minecraft.util.Identifier getArmorTexture(net.minecraft.entity.LivingEntity entity, net.minecraft.item.ItemStack stack, net.minecraft.entity.EquipmentSlot slot, boolean secondLayer, @Nullable @Nullable String suffix, net.minecraft.util.Identifier defaultTexture)
Identifier
.entity
- The entity equipping the armorstack
- The item stack of the armorslot
- The slot which the armor is insecondLayer
- True if using the second texture layersuffix
- The texture suffix, used in vanilla by DyeableArmorItem
defaultTexture
- The default vanilla texture identifier