Skip to content

Continuity Connected Textures Specification

PepperCode1 edited this page Jul 31, 2024 · 1 revision

This page documents the differences between the Continuity connected textures specification and the OptiFine connected textures specification. Unless otherwise stated, assume Continuity supports all features of the OptiFine specification and only the features of the OptiFine specification. Listed changes will only consider actual behavior of OptiFine and not what is stated in documents of the OptiFine specification, including the official one, as they may be incorrect.

Terms

  • "specification" refers to the Continuity or OptiFine connected textures specification, depending on context.
  • "connected textures file" refers to a file that contains a connected textures definition in accordance to a certain specification.
  • "property" refers to a key or its value in a connected textures file.
  • "method" refers to a unique value of the method property and its associated behavior.

General Changes

This section documents changes that are not directly related to the format and behavior of individual connected textures files.

Arbitrary Namespaces

Connected textures files will be loaded from all resource pack namespaces. In the OptiFine specification, connected textures files are only loaded from the minecraft namespace.

Suggestions

This behavior can be used to better organize connected textures files in resource packs. This behavior can also be used to create connected textures files that are loaded by Continuity but not OptiFine.

Method Changes

This section documents changes in the behavior of certain methods.

ctm

See the orient property.

ctm_compact

See the orient property.

horizontal

The innerSeams property is respected. This property's format and behavior are the same as with the ctm method.

See the orient property.

horizontal+vertical

The innerSeams property is respected. This property's format and behavior are the same as with the ctm method.

A texture will not connect vertically to an adjacent texture if the adjacent texture is already connected horizontally on the same face.

OptiFine Continuity
horizontal+vertical_optifine horizontal+vertical_continuity

See the orient property.

repeat

The symmetry property is respected. This property's format and behavior are the same as with the random method.

top

The innerSeams property is respected. This property's format and behavior are the same as with the ctm method.

vertical

The innerSeams property is respected. This property's format and behavior are the same as with the ctm method.

See the orient property.

vertical+horizontal

The innerSeams property is respected. This property's format and behavior are the same as with the ctm method.

A texture will not connect horizontally to an adjacent texture if the adjacent texture is already connected vertically on the same face.

OptiFine Continuity
vertical+horizontal_optifine vertical+horizontal_continuity

See the orient property.

New Methods

This section documents methods that are exclusive to the Continuity specification.

overlay_horizontal

This method creates an overlay, the texture for which is computed using the same logic as used by the horizontal method.

overlay_vertical

This method creates an overlay, the texture for which is computed using the same logic as used by the vertical method.

overlay_horizontal+vertical

Aliases: overlay_h+v

This method creates an overlay, the texture for which is computed using the same logic as used by the horizontal+vertical method.

overlay_vertical+horizontal

Aliases: overlay_v+h

This method creates an overlay, the texture for which is computed using the same logic as used by the vertical+horizontal method.

Property Changes

This section documents changes in the behavior of certain properties or parsing of certain property values. These changes apply to all connected textures files regardless of method.

heights

Each height range may use the ellipsis format. A height range cannot use the ellipsis format and standard format at the same time. A height range will be parsed using the ellipsis format instead of the standard format if and only if it contains an ellipsis, defined as the string ... A height range in the ellipsis format will be valid if and only if exactly one of the following cases is fulfilled.

  • If there is an integer left of the ellipsis but not right of the ellipsis, the height range will match if the Y-coordinate is greater than or equal to the integer.
  • If there is an integer right of the ellipsis but not left of the ellipsis, the height range will match if the Y-coordinate is less than or equal to the integer.
  • If there are integers on both sides of the ellipsis, the height range will match if the Y-coordinate is between the integers or equal to either integer.
Examples
  • The height range -64.. will match a Y-coordinate greater than or equal to -64.
  • The height range ..256 will match a Y-coordinate less than or equal to 256.
  • The height ranges -16..128 and 128..-16 will match a Y-coordinate greater than or equal to -16 and less than or equal to 128.

tiles

Each sprite location may contain a defined namespace, as allowed by the Minecraft resource location format. Paths of sprite locations with a defined namespace are parsed differently than sprite locations without a defined namespace. The differences are as follows.

  • The substring assets/minecraft/ at the start of a path will not be removed.
  • The substring ./ at the start of a path will not be replaced with the path to the current connected textures file.
  • The substrings ~/ and / at the start of a path will not be replaced with the string optifine/.
  • Paths which do not contain a / are relative to textures/block/. Paths which start with textures/ or optifine/ are absolute. Otherwise, the path is relative to textures/.
  • Paths will not be parsed as ranges of integer file names.
Examples
  • The sprite locations minecraft:block/obsidian and minecraft:textures/block/obsidian.png refer to the file at the absolute root path assets/minecraft/textures/block/obsidian.png.
  • The sprite location namespace:0 refers to the file at the absolute root path assets/namespace/textures/block/0.png.
  • The sprite location minecraft:0-46 refers to the file at the absolute root path assets/minecraft/textures/block/0-46.png.
  • The sprite location namespace:optifine/ctm/texture refers to the file at the absolute root path assets/namespace/optifine/ctm/texture.png.

New Properties

This section documents properties that are exclusive to the Continuity specification. All properties are optional.

optifineOnly

Type: boolean
Default value: false
Methods: all

When this property is set to true, the current connected textures file will not be loaded. This property is only respected by connected textures files located in the minecraft namespace.

orient

Type: enum: NONE, STATE_AXIS, TEXTURE
Default value: TEXTURE if the method is ctm, ctm_compact, horizontal, vertical, horizontal+vertical, or vertical+horizontal; NONE otherwise
Methods: ctm, ctm_compact, horizontal, vertical, horizontal+vertical, vertical+horizontal, repeat, overlay_ctm, overlay_repeat, overlay_horizontal, overlay_vertical, overlay_horizontal+vertical, overlay_vertical+horizontal

An orientation represents zero to three 90° rotations and zero to one axis-aligned reflections applied in two-dimensional space; as a result, there are eight possible orientations. The standard orientation is defined as the orientation that represents zero rotations and zero reflections. Two-dimensional objects and processes can have an orientation. For example, a texture on a block model has an orientation because the texture is two-dimensional and it can be rotated and reflected.

Methods which respect this property utilize orientations and this property defines how the current orientation is derived. For example, the ctm method uses the current orientation to know which block is on the left (a relative direction), which is then used to determine the sprite index.

  • With NONE, the current orientation is always the standard orientation. The standard orientation for a specific face is defined as the orientation of the texture on that face on any cube block model (more specifically, parents of the minecraft:block/cube model that do not replace the elements) in vanilla, such as the glass block model. These textures are considered to not be rotated or reflected.
  • With STATE_AXIS, the current orientation is as defined by NONE if the current block state does not have the axis block state property. Otherwise, the current orientation is the orientation of the texture found on a cube column block model (more specifically, parents of the minecraft:block/cube_column model that do not replace the elements) in vanilla such that the model is rotated by 90° on the X and Y axes for block states with axis=x, not rotated for block states with axis=y, and rotated by 90° on the X axis for block states with axis=z, as defined in a block state model file. Examples of blocks whose vanilla models follow these rules include basalt, bone blocks, deepslate, and hay bales. Note that the vanilla models of any sort of log do not follow these rules.
  • With TEXTURE, the current orientation is the orientation of the texture that connected textures are currently being applied to.

Even though the OptiFine specification does not have this property, the behavior of certain methods in the OptiFine specification can still be described using certain values of this property. In other words, certain methods exhibit behavior that is identical to the behavior produced by certain values of this property.

The following table shows methods from the OptiFine specification whose behavior in the OptiFine specification differs from their default behavior in the Continuity specification in terms of this property. For all other methods, the OptiFine behavior and default Continuity behavior are identical in terms of this property.

Method OptiFine Continuity Default
ctm NONE TEXTURE
ctm_compact NONE TEXTURE
horizontal STATE_AXIS TEXTURE
horizontal+vertical STATE_AXIS TEXTURE
vertical STATE_AXIS TEXTURE
vertical+horizontal STATE_AXIS TEXTURE
Examples

In vanilla, the textures on the west and north faces of glass panes are reflected horizontally, meaning these textures on the block model do not have the standard orientation. The following images compare how, when using the ctm method, connected textures are applied to the north faces of adjacent glass panes. The values NONE and STATE_AXIS yield the same result for glass panes because the glass pane block does not have the axis block state property. Note that the behavior seen here with the NONE value is not seen in game when using OptiFine because OptiFine overrides the glass pane models to remove the texture reflection. Continuity does not override any block models.

NONE and STATE_AXIS TEXTURE
glass_pane_ctm_north_orient_none glass_pane_ctm_north_orient_texture

This property is also useful with the repeat method. In vanilla, models for blocks with the axis block state property rotate textures based on the value of that property, meaning these textures do not have the standard orientation. The following images compare how, when using the repeat method, width=2, and height=2, connected textures are applied to the north faces of adjacent basalt blocks with the block state property value axis=x. The displayed numbers correspond exactly to the selected sprite index.

NONE STATE_AXIS and TEXTURE
basalt_repeat_north_orient_none basalt_repeat_north_orient_texture
Suggestions

STATE_AXIS should generally not be used and TEXTURE is recommended instead. Using STATE_AXIS can lead to issues, such as in the case of logs, whose east texture with axis=x and north texture with axis=z have a different orientation than that produced by STATE_AXIS. STATE_AXIS is mainly available to allow exactly replicating OptiFine's behavior for certain methods.

Even though this property is respected by some overlay methods, it is generally not useful on them because overlay textures always have the standard orientation.

prioritize

Type: boolean
Default value: true if the matchTiles property is defined; false otherwise
Methods: all

Connected textures files for which this property is true will always be applied before connected textures files for which this property is false, regardless of resource pack order and file location.

Examples

Consider the following scenario in which there are two connected textures files that are located in the same resource pack.

File A: assets/minecraft/optifine/ctm/_overlays/sand.properties

method=overlay
matchBlocks=dirt
connectBlocks=sand
tiles=0-16

File B: assets/minecraft/optifine/ctm/dirt.properties

method=random
matchTiles=dirt
tiles=0-3

Connected textures files that use overlay methods must be applied before files that use non-overlay methods for the overlays to appear. In this scenario, file A comes before file B alphabetically and both files are in the same resource pack. However, file B will be applied first because it defines the matchTiles property while file A does not. Adding prioritize=false to file B allows file A to be applied first, as defined by the alphabetical order, allowing the overlay to appear.

resourceCondition

Type: custom
Methods: all

This property allows connected textures files which define it to only be loaded when certain resources are provided by certain resource packs. A resource is provided by a resource pack when the resource pack is the highest priority resource pack out of all resource packs that contain the resource.

The property value is separated into checks by the string |. Each check must start with a resource location. The path of the resource location is absolute and identifies the resource to check. The resource location may be followed by the string @ and then the string default or programmer_art, identifying the resource pack. If the resource pack string is default or not present, the resource must be provided by the default resource pack for the check to pass. If the resource pack string is programmer_art, the resource must be provided by the programmer art resource pack for the check to pass. All checks must pass for the connected textures file to be loaded.

Examples
  • A connected textures file with the property value minecraft:textures/block/glass.png or minecraft:textures/block/glass.png@default will only be loaded if the resource minecraft:textures/block/glass.png is provided by the default resource pack.
  • A connected textures file with the property value minecraft:textures/block/sandstone.png@programmer_art will only be loaded if the resource minecraft:textures/block/sandstone.png is provided by the programmer art resource pack.
  • A connected textures file with the property value textures/block/birch_log.png@default|textures/block/oak_log.png@programmer_art will only be loaded if the resource minecraft:textures/block/birch_log.png is provided by the default resource pack and the resource minecraft:textures/block/oak_log.png is provided by the programmer art resource pack.
Suggestions

This property is most useful for built-in resource packs, such as mod resources. File resource packs, such as those distributed as ZIP files, should generally not use this property.

Suppose the sprites used by a certain connected textures file were created using a sprite from the default or programmer art resource pack. This property can be used to ensure that this connected textures file is not loaded when the original sprite is replaced by a different resource pack.