Skip to content

Variant Textures

MehVahdJukaar edited this page Dec 17, 2024 · 8 revisions

Variant Textures

Weather and Day Time Animated Textures

This is a feature that allows having a new type of Animated Texture that depends on Day Time or Weather instead of Game Time. You can use this to create smart animations that change at night. Think about a window block that changes at night for example or flowers that change as day pass, simulating seasons.

To activate it all you need to do is adding the mode parameter to yout animatex texture .png.mcmeta file.

mode explanation
day_time Time of day. First frame at time 0, last frame at time 23999, by default. Loops back
game_time gametime. By default does not loop back
weather Weather. First frame for clear, middle frame for rain, last frame for thunder. Doesn't loop back

Here's an example:

{
  "animation": {
    "interpolate": true,
    "frametime": 25,
    "mode": "day_time"
  }
}

If you want custom cycle durations (aka to make months for things like seasons). you can use the time_cycle_duration variable, by default its set at 24000 or 1 ingame day.

Note that the frame timings parameters that you can normally use in a .mcmeta file will still work but won't represent time in ticks anymore. Instead the entire animation duration will be stretched and scaled to fit exactly 1 minecraft day worth of ticks, or 24000 ticks or whatever is specified in time_cycle_duration.

On and in case you have any mod that changes day time and does NOT change its value in SharedConstants (as it should), you can add here the time_cycle_duration parameter. This is used for both day_time mode, to represent max day duration, and game_time mode, to represent max days duration before the animation loops back.

Remember thar you can turn on or off interpolation depending on your needs.

Biome Variant Textures

Biome Variant Texture features allows users to define specific textures for a specific Block to have Variants based off the biome.

Disclaimer

This section is considered EXPERIMENTAL and could cause issues / not work with other mods or even slow the game down. Use with care and provide feedback as needed please.

As on now this feature only works on FORGE.

Json Format

To start you'll need to define a .json in assets/[target block namespace]/polytone/variant_textures/[target block name].json.

Explicit targeting

Alternatively, if you want to manually specify your target blocks, you can place this json in assets/[your pack namespace]/polytone/variant_textures/[some name].json (Any path will work but this is recommended to avoid overwriting Implicit defined targets). Useful if you want yo modify more than 1 target for the same json.

Then you can add the targets field containing a list of valid block ids to the json as follows:

{
   "targets": ["minecraft:dirt", "minecraft:grass_block"]
}

Inside this file you'll have to define a Map of Texture locations to a Map of Biome ids to Texture locations.

This will be the format used:

{
   "textures": {
      "[origin texture path]": {
         "[target biome id]": "[target texture path]"
      }
   }
}

Let's see an example:

{
   "textures": {
      "minecraft:block/bamboo_block_top": {
         "minecraft:forest": "block/dirt",
         "plains": "minecraft:block/bedrock"
      }
   }
}

In this example we are giving the Bamboo Block's block/bamboo_block_topTexture two variants when in the Forest and Plains biome, each being the Dirt texture and the Bedrock texture.