Aquaculture 2

Aquaculture 2

86M Downloads

Incompatibility with BadOptimizations

MoonstruckDev opened this issue · 25 comments

commented

Have the string optimization enabled and the colours/dyes no longer work on the bobber/fishing line

Forge: 47.2.30
Mod Version: 2.5.1
BadOptimizations Version: 2.1.0

Whether String.format should be redirected to a faster StringBuilder when calculating the FPS string. enable_fps_string_optimization: true

commented

So uh-I just downloaded the mod. How do you use the bobber? Trying to get more details on this, cause making the entity renderer thing auto-disable with this mod like i did with twilight forest is more of the "destructive last resort" option.

commented

It should be explained on the wiki (Which is at the top here on Github)
Short version:

  • You add it on the tackle box (block entity with GUI)
  • Put in a fishing rod from AQ2 in the fishing rod slot, to equip the bobber/line
  • The bobber and line are items, which can be dyed like leather (Both in-world renders break, with the "enable_entity_renderer_caching" enabled)
commented

2024-05-17_19 20 52
What the-how do you activate this?

commented

You take the fishing rod out of the tackle box again :)
You need to dye the fishing line and/or bobber first though, in a crafting table, with any dye.

commented

mod.zip
Uh, messed with some mixins?

commented

No luck unfortunately. Still doesn´t work (With default config)

commented

I just tried it with 1.20.4 and it worked fine. Odd. Could have something to do with neoforge. Do you still maintain your 1.20.1 versions?

I'm thinking about just making BO auto-disable entity rendering optimizations with this mod in versions < 1.20.2, probably?

commented

Do you mean in-world or in the inventory?

commented

In world- when you cast, the line and bobber is uncoloured

commented

I was able to reproduce it. There is nothing I can do about it on my end, as they're messing with the rendering.
It would have to be done on their end.

commented

I can’t seem to find the conflicting code, can you tell me where it is? (Although I am a little confused on how an fps string optimization conflicts with an entity renderer)

commented

Sure thing!
It´s done in the AquaBobberRenderer, here specifically for the fishing line: (Should hopefully be able to find the bobber overlay in there as well - I do have things commented for once!)
https://github.com/TeamMetallurgy/Aquaculture/blob/master/src/main/java/com/teammetallurgy/aquaculture/client/renderer/entity/AquaBobberRenderer.java#L147

commented

It could quite well be that it gets the colors from the item line/bobber items, which does extend DyeableLeatherItem.
The line still renders as if though no colors had been applied to the items, when BadOptimizations is installed.

https://github.com/TeamMetallurgy/Aquaculture/blob/master/src/main/java/com/teammetallurgy/aquaculture/item/DyeableItem.java#L19

commented

That's just a vertex renderer-how is it conflicting with the FPS string?! Must be something else.

commented

Sorry for the late response-does disabling entity flag optimizations from BadOptimizations fix the issue?

commented

All good!
Setting "enable_entity_flag_caching" to false did not fix the issue, no. Left all other configs options as default.

commented

Then which config option causes it?

commented

Called it

commented

Disabling the "enable_entity_renderer_caching" config option, does indeed fix it!

commented

Unfortunately not, no.

commented

Well it’s not the fps string optimization, cause that version just plain removes it.

commented

Couldn´t get it to work with either, with just disabling the "fps string optimization" config either. Not sure what it could be!

commented

Hm. You could just brute-force every config option until it works.

commented

mod.zip
Does this version fix it?

commented

My next idea is maybe it conflicts with the entity renderer optimizations. Can you try that?