Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-262600

Tripwire texture can rotate unexpectedly when neighbouring connections change / is mapped inconsistently

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.4, 1.20 Pre-release 1
    • None
    • Confirmed
    • Textures and models

      The bug

      The way tripwire's texture is applied to the model is inconsistent, and will often rotate unpredictably if blocks are changed near it.

      Why this happens

      Tripwire still uses a very outdated system for determining adjacent connected blocks to determine its model. In release 1.9, blocks such as fences and redstone wire started to make use of the then newly introduced multipart system, which resolved several issues such as the presence of redundant models. However, tripwire's model was never updated, and is still stuck using the outdated system in modern versions.

      In addition to this causing undesirable issues such as the texture rotation problem this ticket describes, it also causes the tripwire blockstates file to be far more bloated than it needs to be, since every state combination needs to be accounted for rather than simple boolean checks. In addition, the model files used are also larger than necessary.

      This same underlying issue is the same reason why MC-203397 occurred, and can be fixed in a similar fashion by converting over to multipart models.

      How to reproduce

      A resource pack which replaces tripwire's texture with a debug texture is attached to this ticket. While not strictly necessary to reproduce this issue, it should make the issue much clearer to see.

      1. Create a plus shape out of five uits of tripwire
      2. Pay close attention to the center of this plus shape
      3. Break one of the tripwire pieces to the north, east or south of the center piece, while still keeping an eye on the center

      Expected results

      The only change that would happen to the inner piece of tripwire would that it would lose its connection to the side that was broken, since it was destroyed.

      Actual results

      The texture mapping of the inner piece of tripwire shifts around a lot due to the adjacent piece being broken.

      How to fix

      I've included two resource packs as attachments to this ticket which fix this issue entirely: a "discreet fix" and a "pixel consistent fix".

      The "discreet fix" solves this issue while making sure tripwire still looks as close to the current vanilla tripwire as possible, and should look virtually identical to what is currently used minus the bug this ticket is focused around. This fix should be used if the aim is for tripwire to retain its current general appearance while still getting rid of this issue.

      The "pixel consistent fix" solves this issue by reworking how tripwire is modelled from the ground up. The texture of tripwire is now applied in a fashion much closer to redstone wire and other blocks, meaning that tripwire's texture uses the same resolution as almost all other blocks in the game (MC-221847) and defaults to a cross shape when not connected to anything to make working with it more convenient (MC-262179). In addition, it requires fewer model files and fewer texture planes, and is therefore a better option for file size and game rendering performance. This fix should be used if the aim is for tripwire to be brought closer in line with other blocks in the game.

      To fix this issue, the following model files will need to be deleted from the vanilla assets/minecraft/models/block directory:

      • tripwire_n.json
      • tripwire_ne.json
      • tripwire_ns.json
      • tripwire_nse.json
      • tripwire_nsew.json
      • tripwire_attached_n.json
      • tripwire_attached_ne.json
      • tripwire_attached_ns.json
      • tripwire_attached_nse.json
      • tripwire_attached_nsew.json

      The model files included in one of the two resource packs should then be placed into the assets/minecraft/models/block directory, and the tripwire.json in the resource pack's assets/minecraft/blockstates directory should replace Minecraft's current tripwire.json in its assets/minecraft/blockstates directory.

      I give Mojang my full permission, and strong encouragement, to use the assets of whichever of the two fixes it desires in vanilla Minecraft.

        1. 2023-05-12_20.10.37.png
          2023-05-12_20.10.37.png
          53 kB
        2. 2023-05-12_20.10.53.png
          2023-05-12_20.10.53.png
          125 kB
        3. 2023-05-12_20.10.58.png
          2023-05-12_20.10.58.png
          127 kB
        4. 2023-05-12_20.19.16.png
          2023-05-12_20.19.16.png
          36 kB
        5. 2023-05-12_20.19.20.png
          2023-05-12_20.19.20.png
          32 kB
        6. 2023-05-12_20.19.26.png
          2023-05-12_20.19.26.png
          45 kB
        7. 2023-05-12_20.19.31.png
          2023-05-12_20.19.31.png
          35 kB
        8. 2023-05-12_20.21.36.png
          2023-05-12_20.21.36.png
          47 kB
        9. 2023-05-12_20.21.56.png
          2023-05-12_20.21.56.png
          50 kB
        10. tripwire-fix-discreet-1.20pre1-v1.0.zip
          5 kB
        11. tripwire-fix-pixelconsistent-1.20pre1-v1.0.zip
          3 kB
        12. tripwire-texture-debug-1.20pre1-v1.0.zip
          1 kB

            Unassigned Unassigned
            Awesoman3000 Connor Steppie
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: