sp614x / optifine

1.79k stars 418 forks source link

[CEM] CEM multi-models don't effect the handheld entity #7754

Open SeaOfPixels opened 1 day ago

SeaOfPixels commented 1 day ago

DISCLAIMER: THIS REPORT IS NOT ABOUT CIT TRIDENTS OR RANDOM ENTITIES TRIDENTS, IT IS ABOUT CEM MULTI-MODEL ENTITIES

Description of Issue

The introduction of being able to path to different entity models with CEM has resulted in renamable tridents being extremely close to possible.

  1. With CIT, it's possible to change the inventory trident item based on name.
  2. With CEM multi-models, it's possible to change the trident entity when thrown based on name.

However, even though the thrown trident entity is correctly applying its texture based on name using CEM multi-models, the trident entity in the hand is still unaffected.

Trident renames are so close to being possible, is it possible to make OptiFine apply the multi-model entity texture to the handheld entity? I want to stress that I only created this report because it was discovered that CEM multimodels could change the trident entity based on rename when thrown, I would not have created this report otherwise as it is known that trident CIT & random entities renaming wasn't possible before CEM multi-models were introduced.

Screenshot

Note how the gui trident item is working based on name, the thrown trident entity is working based on name, but only the handheld trident entity isn't working: 2024-09-18_04 23 26 2024-09-18_04 58 10

Test pack

Trident CEM Renames.zip

Properties & CEM files

GUI trident rename (CIT):

type=item
items=minecraft:trident
texture=red_trident
nbt.display.Name=regex:Red Trident|.*\\(Red Trident\\)|\\(Red Trident\\).*

Entity trident rename (CEM multi-model properties):

models.2=2
name.2=regex:Red Trident|.*\\(Red Trident\\)|\\(Red Trident\\).*

Entity trident rename (CEM model):

{
    "textureSize": [32, 32],
    "texture": "minecraft:optifine/cit/icons/new_default_plus_dungeons/icons_melee/red_trident",
    "models": [
        {
            "part": "body",
            "id": "body",
            "invertAxis": "xy",
            "translate": [0, -27, 0],
            "boxes": [
                {"coordinates": [-0.5, 0, -0.5, 1, 25, 1], "textureOffset": [0, 6]},
                {"coordinates": [-8, 0, 0, 16, 16, 0], "textureOffset": [0, 16]}
            ]
        },
        {
            "part": "base",
            "id": "base",
            "invertAxis": "xy",
            "translate": [0, -27, 0],
            "boxes": [
                {"coordinates": [-1.5, 25, -0.5, 3, 2, 1], "textureOffset": [4, 0]}
            ]
        },
        {
            "part": "left_spike",
            "id": "left_spike",
            "invertAxis": "xy",
            "translate": [0, -27, 0],
            "boxes": [
                {"coordinates": [1.5, 26, -0.5, 1, 4, 1], "textureOffset": [4, 3]}
            ]
        },
        {
            "part": "middle_spike",
            "id": "middle_spike",
            "invertAxis": "xy",
            "translate": [0, -27, 0],
            "boxes": [
                {"coordinates": [-0.5, 27, -0.5, 1, 4, 1], "textureOffset": [0, 0]}
            ]
        },
        {
            "part": "right_spike",
            "id": "right_spike",
            "invertAxis": "xy",
            "mirrorTexture": "u",
            "translate": [0, -27, 0],
            "boxes": [
                {"coordinates": [-2.5, 26, -0.5, 1, 4, 1], "textureOffset": [4, 3]}
            ]
        },
        {
            "part": "root",
            "id": "root",
            "invertAxis": "xy",
            "translate": [0, 0, 0]
        }
    ]
}

OptiFine Version

OptiFine 1.21.1_HD_U_J1_pre14

SeaOfPixels commented 1 day ago

https://github.com/user-attachments/assets/967777ee-8bc3-4c57-b8fc-83f92463a180

Video demonstration of multimodel CEM not applying to handheld entities: