Skip to content

Commit

Permalink
fix(docs): Add information about color handlers
Browse files Browse the repository at this point in the history
Closes #183
  • Loading branch information
ChampionAsh5357 committed Oct 23, 2024
1 parent e46e593 commit 1d9d59a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/resources/client/models/modelloaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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

0 comments on commit 1d9d59a

Please sign in to comment.