Fluid Cuboid
See also: Tank Model.
Fluid cuboids are a JSON object used in many different loaders in Mantle and Tinkers’ Construct to specify the location of fluids in models or renderers. This page describes both the format for fluid cuboids along with common usages of them in Mantle and Tinkers’ Construct.
Format
A fluid cuboid is defined in JSON as follows:
- Start location of the cuboid.
- End location of the cuboid.
- direction to face data. If unset, equivelent to setting all 6 directions to an empty object.
- direction values.
- Texture rotation in degrees, must be 0, 90, 180, or 270. If unset, defaults to 0.
- If true, uses the flowing fluid texture, which animates flow towards the texture bottom. If false (default), uses the still fluid texture.
A single fluid face. Key is one of six
Map of face - direction values.
The fluid cuboid object.
Vector coordinates are in pixel values (that is, 1/16 of a block).
Block Fluids
For the format used from 1.16 to 1.19, see Fluids Model.
Block fluids are JSON files used since 1.20 to specify the location for fluids to render in a block fluid renderer. The block fluid located at assets/<domain>/mantle/model/block_fluids/<name>.json
corresponds to the block ID <domain>:<name>
. It has the following format:
<variant>
is a Block State Variant representing the block state properties that receive these fluids.- template containing the fluid cuboids for this variant. Path to a
- Sets states matching the variant to contain a single fluid cuboid.
- A fluid cuboid in the list.
Sets states matching the variant to contain a list of fluid cuboid.
Object containing a map from variant to fluids. Each key
A block fluid JSON.
Block Fluids Template
Often, a set of fluid cuboids is the same for several different blocks or block states. In such cases, it is useful to create a template containing that information and reference it from the block state variant.
Templates are located in assets/<domain>/mantle/model/block_fluids/<name>.json
for the template named <domain>:<name>
. This directory is the same as the directory for block fluids, meaning its important that a template never be stored at the ID of a block. By convention, templates are placed in assets/<domain>/mantle/model/block_fluids/templates/
to avoid this problem (which makes the ID <domain>:templates/<name>
).
Block fluid templates have either of the following formats:
- A JSON object represents a template containing a single fluid cuboid.
- A fluid cuboid in the list.
A JSON list represents a template containing a list of fluid cuboids.
Faucet Fluids
Faucet fluids are a JSON format defined in Mantle and used by Tinkers’ Construct and Ceramics to determine how to render the pouring animation in a block. The faucet fluid for the block ID <domain>:<name>
is located in assets/<domain>/mantle/model/faucet_fluid/<name>.json
(from 1.20 onwards) or in assets/<domain>/models/faucet_fluid/<name>.json
(from 1.16 to 1.19). They have the following format:
<variant>
is a Block State Variant representing the block state properties that receive these fluids.
Object containing a map from variant to fluids. Each key
A block fluid JSON.
Default Faucet Fluid
The faucet fluid with location mantle:_default
is treated as a template, used both as the default if a block has no faucet fluid data defined and allows simplifying the syntax to create faucet fluids.
Faucet Fluid Template
Faucet fluid data is specified in the following format:
- Fluid cuboid to render when a faucet is facing sideways.
- A fluid cuboid in the list.
List of fluid cuboids to render when a faucet is facing sideways.
- Fluid cuboid to render when a faucet is facing downwards.
- A fluid cuboid in the list.
List of fluid cuboids to render when a faucet is facing downwards.
- If true, the fluid “passes through” the block and should also render in the block below. Defaults to false.
A faucet fluid object.
In addition, for any usages of templates other than the default faucet fluid, the following fields exist:
- Sets the side fluid to a copy of the default fluid with the specified lower bound in pixels.
- Sets the center fluid to a copy of the default fluid with the specified lower bound in pixels.
- Sets both the side and center fluids to a copy of the default fluids with the specified lower bound in pixels, assuming its not already set.
A faucet fluid object.
Since 1.20, templates may be defined under are located in assets/<domain>/mantle/model/faucet_fluid/<name>.json
for the template named <domain>:<name>
. This directory is the same as the directory for faucet fluids, meaning its important that a template never be stored at the ID of a block. By convention, templates other than the default are placed in assets/<domain>/mantle/model/block_fluids/templates/
to avoid this problem (which makes the ID <domain>:templates/<name>
).
Channel Fluids
For the format used from 1.16 to 1.19, see Channel Model.
Channel fluids are used since 1.20 to define the location of fluids within a casting channel in Tinkers’ Construct or Ceramics. Channel fluids are defined underassets/<domain>/mantle/model/channel_fluids/<name>.json
for the block or template named <domain>:<name>
. They have the following format:
- If set, loads properties from the channel fluid template at the specified location for any properties not set in this JSON.
- Fluid cuboid to when the channel is pouring down.
- Fluid to render when the center is not moving.
- Fluid to render when the center is moving. Will be rotated the proper direction.
Fluid to render in the center of the channel.
- Fluid to render when the side is still.
- Fluid to render when there is no fluid entering or exiting that side.
- Fluid to render when fluid is pouring in from that side.
- Fluid to render when fluid is pouring out from that side.
Fluid to render on each of the four sides of the channel.
A channel fluid object.