Repository navigation
Connecting Texture Type
Connecting textures are textures with a special layout that allows them to connect to other blocks. Under what circumstances a connecting texture connects is configurable. Connecting textures can also be combined with other texture types and can be animated.
Connecting textures have the following properties:
Note
Connecting textures also support all properties of the base texture type.
| key | values | default | description |
|---|---|---|---|
layout |
pieced,simple,full,vertical,horizontal,compact,overlay
|
full |
Layout of the image |
connections |
A connection predicate or array of connection predicates |
is_same_state |
The conditions for when the texture should connect in a certain direction |
sub_texture |
Texture metadata | None | Metadata used for each tile as if each tile were its own texture |
per_tile_animation |
true or false
|
false |
Whether each tile contains its animation frames |
Here is an example of what the metadata file for a connecting texture could look like:
{
"fusion": {
"type": "connecting",
"layout": "pieced",
"connections": [
{
"type": "is_same_block"
},
{
"type": "match_block",
"block": "iron_block"
}
],
"sub_texture": {
"type": "random",
"rows": 5,
"columns": 5
},
"per_tile_animation": true
}
}Fusion offers 5 connected texture layouts: pieced, simple, full, vertical, horizontal, compact and overlay. This section will go over all the layouts.
If you are getting started and are unsure which layout to use, the pieced layout is recommended.
Tip
Templates for all the connecting texture layouts can be found in the Fusion Examples repository.
Note
In some cases, you may need only a few tiles of a layout. You can do so without wasting resources by leaving the unnecessary tiles completely empty. Empty tiles (fully transparent) won't be processed or stitched to the texture atlas.
The pieced layout has only 5 tiles and works by combining corner pieces from each. It does not have quite the same capabilities as the full or simple layouts, but it is able to create a bordered texture whilst requiring far fewer tiles.
{
"fusion": {
"type": "connecting",
"layout": "pieced"
}
} |
|
The simple layout allows textures to connect to their four direct neighbors. This is ideal for textures which aren't affected by diagonal connections.
{
"fusion": {
"type": "connecting",
"layout": "simple"
}
} |
|
The full layout allows textures to connect to all eight neighboring blocks, so also diagonally. It is the most extensive layout and thus also allows for the most control over connections. Most of the other layouts can also be achieved using the full layout, however it is advisable to use a simpler layout if possible to avoid duplicate tiles.
{
"fusion": {
"type": "connecting",
"layout": "full"
}
} |
|
The vertical layout allows textures to connect just vertically.
{
"fusion": {
"type": "connecting",
"layout": "vertical"
}
} |
|
The horizontal layout allows textures to connect just horizontally.
{
"fusion": {
"type": "connecting",
"layout": "horizontal"
}
} |
|
The compact layout consists of only 5 tiles and is intended to give a seemingly complex connection pattern with little effort. It contains an end tile, a center tile, a vertical section, a horizontal section and a cross section.
{
"fusion": {
"type": "connecting",
"layout": "compact"
}
} |
|
The overlay layout is intended for block overlays and works by overlaying multiple tiles to get the correct connections.
{
"fusion": {
"type": "connecting",
"layout": "overlay"
}
} |
|
To determine how a connecting texture connects, you can use connection predicates. When picking which tiles to use, Fusion first evaluates the connection predicates for all eight neighboring directions of the texture, one direction at a time. This results in a true/false flag for each direction. From these flags, the layout picks the tiles to use.
There are 13 types of connection predicates available:
-
is_same_block: true if the block in the connection direction is the same as the model itself -
is_same_state: true if the block in the connection direction is the same and has the same block properties as the model itself -
match_block: true if the block in the connection direction matches the specified blocks-
block/blocks: a block or array of blocks that should be matched -
ignore_missing: boolean, when true any missing blocks will be ignored, useful for modded blocks which may not always be present
-
-
match_state: true if the block in the connection direction matches the specified blocks and the specified block properties-
block/blocks: a block or array of blocks that 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 -
ignore_missing: boolean, when true any missing blocks will be ignored, useful for modded blocks which may not always be present
-
-
match_block_in_front: true if the block in front of the block in the connection direction matches the specified blocks-
block/blocks: a block or array of blocks that should be matched -
ignore_missing: boolean, when true any missing blocks will be ignored, useful for modded blocks which may not always be present
-
-
match_state_in_front: true if the block in front of the block in the connection direction matches the specified blocks and the specified block properties-
block/blocks: a block or array of blocks that 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 -
ignore_missing: boolean, when true any missing blocks will be ignored, useful for modded blocks which may not always be present
-
-
is_direction: true if the connection direction is one of the specified directions-
direction/directions: a direction or array of directions that should be matched, directionstop,top_right,right,bottom_right,bottom,bottom_left,left,top_left
-
-
is_face_visible: true if the face of the block in the connection direction is visible, i.e. not covered by some opaque block -
and: true if all specified predicates are true-
predicates: predicates that all need to be satisfied
-
-
or: true if at least one of the specified predicates is true-
predicates: predicates of which one needs to be satisfied
-
-
not: true if the given predicate is not true-
predicate: predicate of which the inverse will be taken
-
-
true: always true -
false: always false
Examples of connection predicates
{
"type": "is_same_block"
}{
"type": "is_same_state"
}Evaluates to true when the block in the connection direction is a Redstone Torch.
{
"type": "match_block",
"block": "restone_torch"
}Evaluates to true when the block in the connection direction is a Redstone Torch or a Cogwheel from Create. If Create is not installed, create:cogwheel will be ignored.
{
"type": "match_block",
"blocks": ["restone_torch", "create:cogwheel"],
"ignore_missing": true
}Evaluates to true when the block in the connection direction is a Redstone Torch that is off.
{
"type": "match_state",
"block": "restone_torch",
"properties": {
"lit": "false"
}
}Evaluates to true when the block in the connection direction is a Redstone Torch that is off or a Rose Quartz Lamp from Create that is off. If Create is not installed, create:rose_quartz_lamp will be ignored.
{
"type": "match_state",
"blocks": ["restone_torch", "create:rose_quartz_lamp"],
"ignore_missing": true,
"properties": {
"lit": "false"
}
}Evaluates to true when the block in front of the block in the connection direction is a Redstone Torch.
{
"type": "match_block_in_front",
"block": "restone_torch"
}Evaluates to true when the block in front of the block in the connection direction is a Redstone Torch or a Cogwheel from Create. If Create is not installed, create:cogwheel will be ignored.
{
"type": "match_block_in_front",
"blocks": ["restone_torch", "create:cogwheel"],
"ignore_missing": true
}Evaluates to true when the block in front of the block in the connection direction is a Redstone Torch that is off.
{
"type": "match_state_in_front",
"block": "restone_torch",
"properties": {
"lit": "false"
}
}Evaluates to true when the block in front of the block in the connection direction is a Redstone Torch that is off or a Rose Quartz Lamp from Create that is off. If Create is not installed, create:rose_quartz_lamp will be ignored.
{
"type": "match_state_in_front",
"blocks": ["restone_torch", "create:rose_quartz_lamp"],
"ignore_missing": true,
"properties": {
"lit": "false"
}
}Evaluates to true for connection direction right.
{
"type": "is_direction",
"direction": "right"
}Evaluates to true for connection directions top and bottom.
{
"type": "is_direction",
"directions": [ "top", "bottom" ]
}Evaluates to true when the face of the block in the connection direction is visible.
{
"type": "is_face_visible"
}Evaluates to true when the face of the block in the connection direction is visible and the block in the connection direction is gravel.
{
"type": "and",
"predicates": [
{
"type": "is_face_visible"
},
{
"type": "match_block",
"block": "gravel"
}
]
}Evaluates to true when the block in the connection direction is sand or the block in the connection direction is gravel.
{
"type": "or",
"predicates": [
{
"type": "match_block",
"block": "sand"
},
{
"type": "match_block",
"block": "gravel"
}
]
}Evaluates to true when the block in the connection direction is not sand.
{
"type": "not",
"predicate": {
"type": "match_block",
"block": "sand"
}
}Connecting textures can be combined with other texture types. This is achieved through the sub_texture property.
When sub_texture metadata is specified, each tile is essentially treated as its own texture with that metadata.
Here is an example of a connecting texture combined with a random texture:
{
"fusion": {
"type": "connecting",
"layout": "vertical",
"connections": {
"type": "is_same_block"
},
"sub_texture": {
"type": "random",
"rows": 2,
"columns": 2
}
}
} |
|
Connecting textures can also be animated. The setup is the same as for a vanilla animated texture.
Tip
A description of the vanilla animation metadata is available at the Minecraft Wiki.
Here is an example of an animated connected texture:
{
"fusion": {
"type": "connecting",
"layout": "simple",
"connections": {
"type": "is_same_block"
}
},
"animation": {
"frametime": 10
}
} |
|
With large layouts, the different frames for a tile are spread far apart. To combat this, you can use the per_tile_animation property.
When per_tile_animation is true, the different frames are instead grouped per tile.
Here is how the previous example would look with the per_tile_animation property:
{
"fusion": {
"type": "connecting",
"layout": "simple",
"connections": {
"type": "is_same_block"
},
"per_tile_animation": true
},
"animation": {
"frametime": 10
}
} |
|