sp614x / optifine

1.8k stars 418 forks source link

A way to add an enchantment glint to certaint elements of a block model #2320

Open MushirMickeyJoe opened 5 years ago

MushirMickeyJoe commented 5 years ago

How it could work: In Minecraft block models, each element is assigned a name. For example Box1, Box2, etc. I'd love it if we were able to add an enchantment glint to specific elements of a model.

Pretty please 🙏

Cadiboo commented 5 years ago

Can’t you add another box over the top of a box (the one you want to add the enchantment texture to) that has the enchantment texture?

DataCrusade commented 5 years ago

Can’t you add another box over the top of a box (the one you want to add the enchantment texture to) that has the enchantment texture?

You'd have to recreate the enchantment effect because that's not how the enchantment effect works, and it wouldnt match other resource packs.

Cadiboo commented 5 years ago

Isn’t the enchantment effect just an animated texture that you can point to?

Edit: 1) No, it’s not animated (the animation is hardcoded instead of done with .mcmeta) 2) It’s not part of the texture map (it’s a separate texture that’s loaded by the item renderer) 3) The purple color is added when the enchantment is drawn (its hardcoded and not part of the texture)

sp614x commented 5 years ago

Currently Optifine doesn't change anything related to vanilla block models (json). Maybe this would work if added as a texture overlay similar to emissive textures.

ZwipZwapZapony commented 5 years ago

I'd like to say that, no, Minecraft block models do not have names for each element. (Source: Vanilla Minecraft's default block model files, as well as my (unreleased) block models made in a raw text editor.) Minecraft simply seems to ignore the element "names" (or, more specifically, any and all unrecognized things that don't break the file format as a whole).

In my opinion, if OptiFine was to support this, it should be done by making the "shiny" parts simply use a different (but identical-looking) texture, with that texture then (unrelated to the block model file) having some separate OptiFine property file settings to make it look shiny/enchanted.