Class TrimmedArmorModel
- All Implemented Interfaces:
ItemModel
A dynamic model that applies an armor trim texture on top of an existing model when the trim component exists.
NOTE: If multiple mods add a trim material with the same path, only the one that gets loaded last will have its proper colors.
Example: if mod A and mod B register a "tin" trim material, and mod B loads after A, mod B's material will be the one used.
Mod A's ingot will still work just fine as a trim material, it will just look like whatever mod B defined for theirs!
All this means is that if another mod is registering the same material(s) as you and uses this system, your trim colors may not look exactly how you want them to.
This issue can be avoided by making your material path more unique. We would encourage you to prefix your material with your mod id or something along those lines.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface ItemModel
ItemModel.BakingContext -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ItemModel.BakingContextprivate final ItemModelprivate final Identifierprivate static final ModelDebugNameprivate final ItemTransformsprivate final Matrix4fcprivate static final ModelStateprivate static final Transformation -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTrimmedArmorModel(ItemModel baseModel, Identifier baseTrimTexture, ItemModel.BakingContext bakingContext, Matrix4fc transformation) -
Method Summary
Modifier and TypeMethodDescriptionprivate ItemModelcreateTrimLayer(String suffix) voidupdate(ItemStackRenderState state, ItemStack stack, ItemModelResolver resolver, ItemDisplayContext context, @Nullable ClientLevel level, @Nullable ItemOwner owner, int seed)
-
Field Details
-
TRIM_TRANSFORM
-
DEBUG_NAME
-
TRIM_STATE
-
itemsWithTrims
-
baseModel
-
baseTrimTexture
-
bakingContext
-
transformation
-
itemTransforms
-
-
Constructor Details
-
TrimmedArmorModel
private TrimmedArmorModel(ItemModel baseModel, Identifier baseTrimTexture, ItemModel.BakingContext bakingContext, Matrix4fc transformation)
-
-
Method Details
-
update
public void update(ItemStackRenderState state, ItemStack stack, ItemModelResolver resolver, ItemDisplayContext context, @Nullable ClientLevel level, @Nullable ItemOwner owner, int seed) -
createTrimLayer
-