From 1d9d59a7ac3b0c9408f380bdb8a19f24ce40860b Mon Sep 17 00:00:00 2001 From: ChampionAsh5357 Date: Wed, 23 Oct 2024 15:46:34 -0400 Subject: [PATCH] fix(docs): Add information about color handlers Closes #183 --- docs/resources/client/models/modelloaders.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/resources/client/models/modelloaders.md b/docs/resources/client/models/modelloaders.md index feb0b1bd..8808dcdb 100644 --- a/docs/resources/client/models/modelloaders.md +++ b/docs/resources/client/models/modelloaders.md @@ -71,6 +71,18 @@ The dynamic fluid container model, also called dynamic bucket model after its mo } ``` +:::note +If you would like to apply a tint to the fluid texture, you will need to [register an `ItemColor`][tint]. An instance with the fluid tinting logic can be created from `DynamicFluidContainerModel.Colors`: + +```java +// Client-side mod bus event handler +@SubscribeEvent +public static void registerItemColorHandlers(RegisterColorHandlersEvent.Item event) { + event.register(new DynamicFluidContainerModel.Colors(), EXAMPLE_BUCKET.get(), ...); +} +``` +::: + Very often, dynamic fluid container models will directly use the bucket model. This is done by specifying the `neoforge:item_bucket` parent model, like so: ```json5 @@ -83,7 +95,7 @@ Very often, dynamic fluid container models will directly use the bucket model. T } ``` -To [datagen][modeldatagen] this model, use the custom loader class `DynamicFluidContainerModelBuilder`. Be aware that for legacy support reasons, this class also provides a method to set the `apply_tint` property, which is no longer used. +To [datagen][modeldatagen] this model, use the custom loader class `DynamicFluidContainerModelBuilder`. ### Elements Model @@ -472,4 +484,5 @@ public class MyDynamicModel implements IDynamicBakedModel { [modeldatagen]: datagen.md [rendertype]: index.md#render-types [sides]: ../../../concepts/sides.md +[tint]: ./index.md#tinting [transform]: index.md#root-transforms