sp614x / optifine

1.81k stars 418 forks source link

[Bug] Elytra broken textures are not displaying. #5280

Open mibby opened 3 years ago

mibby commented 3 years ago

Description of Issue

Using the optifine/cit feature for custom textured items when named, broken elytras don't seem to display their assigned texture.

Steps to Reproduce

  1. Have custom elytra textures in a resource pack that make use of optifine cit features.
  2. Spawn in a broken elytra and name it to match the cit properties file.
  3. The named elytra doesn't use the broken texture, whereas a non-named elytra does show it is broken with the vanilla texture.
  4. It uses the normal icon texture, not the broken one. In other words, not detecting the elytra durability as broken to use the broken_elytra property?

blue.properties

type=elytra
items=elytra
texture=blue
nbt.display.Name=ipattern:blue elytra

blueicon.properties

type=item
items=elytra
texture.elytra=blueicon
texture.broken_elytra=bluebroke
nbt.display.Name=ipattern:blue elytra

link

OptiFine Version

OptiFine HD U G7 pre4

Installation Method

Standalone installer.

StormClawPonyRises commented 3 years ago

I had a similar issue myself, and managed to fix it: I already had the normal item icon and broken item icon have separate properties files, so the folder would have 3 properties files within it, 1 for each texture file. I'm sure there's a way to fix it without separating them, but I don't know how to do that.

First, I made sure that the broken texture's properties file loaded as priority over the others (or at least, the normal icon texture file). You can do this just by changing it's position in alphabetical order (left/top of the folder is priority i believe). Second, I made sure the item the broken texture was supposed to replace was still the elytra. There is no actual 'broken elytra': to get one in game you need a fully damaged, normal elytra. Next, in a new line after the nbt.display.Name: etc etc etc. write: damage=431 This is the damage level where the elytra's texture is replaced with the broken elytra texture normally. That way the broken texture for your custom elytra will only show up when the elytra has lost all of its' durability.

image

Apologies if this doesn't help!

Cart3r1234 commented 3 years ago

That's a pretty smart workaround for this bug, although it would still be nice for it to be fixed one day

mibby commented 3 years ago

I have a resource pack with hundreds of elytras, so that workaround is not viable for me without being time consuming to add. I'm hoping the shared icon properties file can just be fixed so it detects damaged elytras again.

SeaOfPixels commented 2 years ago

Bumping this, would like to see a fix as I cannot figure out how to get broken elytra textures to display even with the nbt workaround.

aisza69 commented 10 months ago

i know this is old so you probably dont care anymore lol but if it could help someone else in the future then why not share it.

i've encountered the same issue and what worked for me is just downloading a default vanilla minecraft resource pack and copying the elytra.json and broken_elytra.json files from the default resource pack folder (assets/minectaft/models/item) to my own pack (the same path) and it worked. my broken elytra texture was visible when it's durability was at 1 im playing on 1.20.1 btw. hope this helps someone <3

elytra.json broken_elytra.json

SlimyChip commented 2 months ago

hi, i have same problem,

i put those json files in item folder and checked all things that could be wrong as u all said but it still didn't resolve my problem

SlimyChip commented 2 months ago

mybe its bcs i am on 1.21

SlimyChip commented 2 months ago

oh it was my fault i saved file on pnd not png XD

aisza69 commented 2 months ago

lmaoo ive made lots of stupid mistakes like this haha glad you figured it out