Default Model Types
Fusion adds one new model type, the connecting model. Below is an explanation of how to use Fusion's model types as well as an explanation of the connecting model type.
Fusion uses the same json files models as vanilla. However, now the data in the file is determined by the model type. The model type should be specified under the type
key. It is also important to specify "loader": "fusion:model"
to ensure Fusion does not interfere with other mods.
A model file would then look as follows:
{
"loader": "fusion:model",
"type": "<model type>",
<configuration>
}
Connecting models gather data from blocks around them and make sure any connecting textures connect to the specified blocks. When the model should connect can be specified with connection predicates under the connections
key. At least one of the predicates in connections
must be satisfied for the model to connect.
Here is an example of an oak tiles block which connects to itself and acacia tiles:
{
"loader": "fusion:model",
"type": "connecting",
"connections": [
{
"type": "is_same_block"
},
{
"type": "match_block",
"block": "acacia_tiles"
}
],
"parent": "block/cube_all",
"textures": {
"all": "block/oak_tiles"
}
} |
There are 6 types of connection predicates available by default:
-
is_same_block
: connects to blocks with the same type as itself -
is_same_state
: connects to blocks with the same type and block properties as itself -
match_block
: connects to blocks of a given type-
block
: the block which should be matched
-
-
match_state
: connects to blocks of a given type which match the given state properties-
block
: the block which should be matched -
properties
: an object where each key is the name of the property and its corresponding value is an array with allowed values for the property
-
-
is_face_visible
: connects if the face of the neighboring block is visible -
and
: connects if all given predicates are satisfied-
predicates
: predicates which need to be satisfied
-
-
or
: connects if at least one of the given predicates is satisfied-
predicates
: predicates of which one needs to be satisfied
-
-
not
: connects only if the given predicate is not satisfied-
predicate
: predicate of which the inverse will be taken
-
In case you have more than one connected texture on a model, the connections can also be specified per texture. This is again done through the connections
key, however this time it contains an object with one array per texture.
Here is an example of a model where the #blue
texture will connect to ice, the #red
texture will connect to netherrack and the all the other textures will connect to dirt:
{
"loader": "fusion:model",
"type": "connecting",
"connections": {
"blue": {
"type": "match_block",
"block": "ice"
},
"red": {
"type": "match_block",
"block": "netherrack"
},
"default": {
"type": "match_block",
"block": "dirt"
}
},
"parent": "block/cube",
"textures": {
"blue": "block/texture1",
"red": "block/texture2",
"all": "block/texture3",
"up": "#blue",
"down": "#blue",
"north": "#red",
"east": "#red",
"south": "#all",
"west": "#all"
}
}