Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forge breaking color.properties #1470

Open
MastaNub opened this issue Jun 22, 2018 · 9 comments
Open

Forge breaking color.properties #1470

MastaNub opened this issue Jun 22, 2018 · 9 comments

Comments

@MastaNub
Copy link

Forge breaks color.properties for text.xpbar.
Optifine:
https://imgur.com/a/6boJ7K8
Forge with OF:
https://imgur.com/a/KYrnqaO

@sp614x
Copy link
Owner

sp614x commented Jun 24, 2018

Forge uses a custom experience bar rendering that OptiFine can't directly change.

@MastaNub
Copy link
Author

@sp614x is it fixable?

@sp614x
Copy link
Owner

sp614x commented Jun 24, 2018

There is a workaround to fix it, but it may have negative impact on the performance. It needs some testing to check if the FPS impact is noticeable/acceptable.

@MastaNub
Copy link
Author

Any progress? 😋

@Invades
Copy link

Invades commented Nov 30, 2020

This still appears to happen and is really frustrating, any progress? It's been more than 2 years ever since this bug report.. It would at least be nice to know what the workaround is. (I'm using latest OF preview and forge versions on 1.8.9)

EDIT: I also tried using a couple of OF versions before that and the recommended forge version instead but that didn't seem to change anything. (didn't think it would but I tried anyways just in case)

@Invades
Copy link

Invades commented Nov 30, 2020

@sp614x

@Moulberry
Copy link

Moulberry commented Dec 3, 2020

This is trivial to fix.

Mixin example (for L5):
`@Mixin(GuiIngameForge.class)
public class MixinGuiIngameForge {

@Redirect(method="renderExperience",
        at=@At(
                value = "INVOKE",
                target = "Lnet/minecraft/client/gui/FontRenderer;drawString(Ljava/lang/String;III)I"
        )
)
public int renderExperience_drawString(FontRenderer fr, String str, int x, int y, int color) {
    if(color == 8453920) {
        color = CustomColors.getExpBarTextColor(color);
    }
    return fr.drawString(str, x, y, color);
}

}`

The example fix for L6 is more complicated because of default package shenanigans which requires reflection.
I have forwarded the information to the guys over at Sk1er who might be able to implement it in under 2 years.

@ghost
Copy link

ghost commented Dec 3, 2020

image
here's above's fix implemented in asm, which is likely the best way to approach this if you end up fixing it yourself
search for 8453920, add an instruction right after that calling CustomColors.getExpBarTextColor(int), which ends up being CustomColors.getExpBarTextColor(8453920); as you're passing 8453920 right before the method is called

@ghost
Copy link

ghost commented Dec 16, 2020

any possibility on this being fixed by the time M5 releases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants