sp614x / optifine

1.81k stars 418 forks source link

[CEM] Shulker boxes render incorrectly in inventory #6275

Open gXLg opened 3 years ago

gXLg commented 3 years ago

Description of Issue

Depending on the texture path in java part model file, the textures of shulker boxes are being rendered wrong. Either it's my mistake, or optifine's.

Files

/assets/minecraft/optifine/cem/

shulker_box.jem

{
  "models": [
    {
      "id": "shulker_overlay",
      "model": "shulker_overlay.jpm",
      "attach": true,
      "part": "lid"
    }
  ]
}

shulker_overlay.jpm

{
    "texture": "textures/entity/shulker/shulker_overlay.png",
    "textureSize": [16, 16],
    "boxes": [
        {
            "coordinates": [-8, -16.01, -8, 16, 0, 16],
            "uvUp": [0, 0, 16, 16]
        }
    ]
}

/assets/minecraft/optifine/random/entities/shulker/

shulker_overlay.properties

textures.2=2
name.2=heart

textures.3=3
name.3=regex:.*

shulker_overlay.png

[empty texture with just one red pixel]

shulker_overlay2.png

[texture with red heart]

shulker_overlay3.png

[empty texture with just one red pixel]

/assets/minecraft/textures/entity/shulker/

shulker_overlay.png

[empty texture with just one red pixel]

The bug

If in the jpm file I specify:

    "texture": "optifine/random/entity/shulker/shulker_overlay.png",

then this renders: 2021-09-26_21 25 27 You can see every shulker box having a single pixel overlay

If in the jpm file I specify:

    "texture": "textures/entity/shulker/shulker_overlay.png",

then this renders: 2021-09-26_21 28 08 You can see the shulker boxes rendering correctly when placed, but wrong in the inventory

ZenithRogue commented 2 years ago

The incorrect rendering in the inventory is the only bug here. Everything else is expected behavior.

Random textures are only supported if the texture being randomized is within the texture/entity folder

texture variants are the only ones that belong in optifine/random/entity