All in one mod for your item trimming needs.
- Almost any item can be a trim material - Even modded
- Most equipment can be trimmed - Even modded
- Custom Shield Trims
- Trim Material Additions
- Animated Trims (Animator)
- Emissive Trims (Glow Ink Sacs)
- Per-trim-pattern item textures
- The item texture overlay now has a custom pattern for each trim pattern rather than a single overlay for all trims.
- This falls back to the old overlay if the trim pattern does not have a provided item texture. See Below
- Animator
- Adding the "Animator" item to a trimmed item in a smithing table (without a pattern) will make the trim animated
- Rainbowifier
- Using the "Rainbowifier" as a trim material will make the trim an animated rainbow
Trimica provides a resource API for modders / modpack makers to provide additional textures or modify existing ones.
Simply add your item to the trimica:all_trimmables tag to allow it to be trimmed, or if the determination is
non-trivial, implement the CraftingRecipeInterceptor API.
For overlay textures the lightness of a pixel will be used to determine the colour index on the palette. For example if there are 8 distinct colours in the overlay texture, the lightest pixel will be the first colour in the palette, the second lightest will be the second colour in the palette, and so on. If there are less than 8 colours in the texture, then only the first N colours will be used. If there are more than 8 colours in the texture, then only the darkest 8 colours will be used, the rest will be made transparent.
To provide a custom overlay texture for a trim pattern, create a new resource pack and add the following to your pack:
assets/trimica/textures/trims/items/<slot_name>/<pattern_namespace>/<pattern_path>.png
For example:
assets/trimica/textures/trims/items/boots/minecraft/bolt.png
This texture will need to be a 16x16 texture.
To provide a custom shield trim, create a new resource pack and add the following to your pack:
assets/trimica/textures/trims/items/shield/<pattern_namespace>/<pattern_path>.png
For example:
assets/trimica/textures/trims/items/shield/minecraft/bolt.png
This texture will need to be a 64x64 texture.
Trimica comes with 2 default material additions:
trimica:animator- This will make the trim animated.minecraft:glow_ink_sac- This will make the trim emissive.
You can make any item a trim material addition by adding it to the trimica:material_additions tag.
See Palette Interceptor for providing a custom palette for a given addition.
To give a material default additions, you can add the following to the material definition:
"trimica$additions": [
<addition_1>,
<addition_2>,
...
]
For example to make diamond animated and emissive by default you would define the material as:
// minecraft/trim_material/diamond.json
{
"asset_name": "diamond",
"description": {
"color": "#6EECD2",
"translate": "trim_material.minecraft.diamond"
},
"override_armor_assets": {
"minecraft:diamond": "diamond_darker"
},
"trimica$additions": [
"trimica:animator",
"minecraft:glow_ink_sac"
]
}Trimica provides an API for modders to interact with the mod and add their own features.
View the latest version of Trimica here
repositories {
maven {
url = "https://maven.bawnorton.com"
}
}
dependencies {
// Loom
modImplementation("com.bawnorton.trimica:trimica-<loader>:<version>")
// MDG
implementation("com.bawnorton.trimica:trimica-<loader>:<version>")
}See each of the endpoints below for more information on how to use them.
- BaseTextureInterceptor
- Where Trimica can find the base overlay textures provided by Custom Patterns if they are not in an expected location, or you want to provide your own schema. i.e. per-item-per-pattern overlays.
- CraftingRecipeInterceptor
- How Trimica determines what items can be used to trim an item or what items can be trimmed.
- PaletteInterceptor
- How Trimica determines the palette for a given item. This can be used in conjuction with Custom Material Additions to provide a custom palette for a given addition.
- TrimRenderer
- Allows you to use Trimica's trim renderer for shields within your own modded shield renderers.
Trimica uses Stonecutter for development.
See the Stonecutter documentation for how to write pre-processor comments when developing.
Once cloned you can set the active project version to the one you want to work on by opening the gradle tab, and running
Tasks/stonecutter/"Set active project to <version>" where <version> is the version you want to set.
To run the mod, set the project version to the one you want to run and run the matchting generated run config.
For example for 1.21.10-fabric you would run Fabric Client 1.21.10. If you attempt to run a different version,
it may fail to load the mod and crash.
Fabric provides client gametests as a part of their API, NeoForge does not, thus, the tests are only avaliable for Fabric.
Set your active project version to a version of Fabric and run the Fabric Client Game Test <version>
task. The tests are located at src/main/java/com/bawnorton/trimica/platform/fabric/test.
To build the mod, run the Tasks/project/buildAndCollect task. This will build the mod for all versions which can
then be found in the root build/libs/ directory.