TeamMetallurgy / Aquaculture

Aquaculture is an expansion of Minecraft's base fishing system. It allows you to catch a variety of new fish with a brand new series of rods and tools
69 stars 73 forks source link

Incompatibility with BadOptimizations #439

Closed MoonstruckDev closed 6 months ago

MoonstruckDev commented 6 months ago

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

GirafiStudios commented 6 months ago

Do you mean in-world or in the inventory?

MoonstruckDev commented 6 months ago

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

GirafiStudios commented 6 months ago

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.

ItsThosea commented 6 months ago

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)

GirafiStudios commented 6 months ago

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

ItsThosea commented 6 months ago

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

GirafiStudios commented 6 months ago

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

ItsThosea commented 6 months ago

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

GirafiStudios commented 6 months ago

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

ItsThosea commented 6 months ago

Then which config option causes it?

ItsThosea commented 6 months ago

mod.zip Does this version fix it?

GirafiStudios commented 6 months ago

Unfortunately not, no.

ItsThosea commented 6 months ago

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

GirafiStudios commented 6 months ago

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

ItsThosea commented 6 months ago

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

ItsThosea commented 5 months ago

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

GirafiStudios commented 5 months ago

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

ItsThosea commented 5 months ago

Called it

ItsThosea commented 5 months ago

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.

GirafiStudios commented 5 months ago

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

ItsThosea commented 5 months ago

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

GirafiStudios commented 5 months ago

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.

ItsThosea commented 5 months ago

mod.zip Uh, messed with some mixins?

GirafiStudios commented 5 months ago

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

ItsThosea commented 5 months ago

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?