Add advanced options to manually enable or disable specific mixins
TsukiTheDwagon opened this issue ยท 24 comments
What it says on the tin. There's a specific use case I have that I want to disable a mixin manually, but there's not really an option to do that in the config menus.
Would be nice to have, I recall some other fabric mods offering a similar option like BedrockIfy.
Can you give any use cases? If it's just something hyper-specific, you can technically disable targeted mixins of any mod by opening the jar with 7zip/winrar and modifying the mixin json file to not contain that line.
I just realized I might actually need a specific config option and not just disabling mixins. I'll leave this open just in case, feel free to disregard this (or add it if you want)
Oh wow, ok yea, never thought that something like that could happen(the sending away part is to move stuff out of the way, that refuses to check for the hidden flag).
Well there was actually a specific obscure mod incompatbility that might not happen in normal usage I had in mind, and it doesn't seem disabling any mixins would specifically stop it, I made this issue when I thought it would.
There's a mod I use called Figura that lets you make custom playermodels, and there's this Lua function in it (you use Lua to script avatars for it) called partToWorldMatrix which gets the world position of a model part.
It's somewhat useful for setting the point of view of the first person camera to match your figura model, but slight problem: It stops working when the model is hidden, which happens when flying with elytra or going from the swimming movement back to a neutral position.
This ends up causing the camera to freak out. I was trying to see if maybe there was a way to stop the mod from hiding the playermodel automatically in those cases altogether, and i thought the elytra mixin was the culprit but it turns out it's spread across more of the mixins.
Why does the camera freak out, shouldn't it just use the vanilla camera(+invisible player), so it's just fine?
I'm manually setting the camera pivot point to said part's location, and since the part gets sent way out of view when it's hidden, the camera gets flung over there as well. It seems just not hiding the part in the first place would solve the issue. Probably set it as some sort of config option because not all avatars would take advantage of the model not hiding.
It only really gets sent super far out with shaders enabled (Iris, not OF) for some reason, not sure if that has to do with anything
Is it possible you can have the hiding toggles be split into head and body though? Because in my specific use case, the head still needs to be hidden and sent out of the way, but the body should not be.
Not really. Doesn't sound right to build in a toggle that just causes visual issues because of this^^. I doubt anyone else has this issue, so the simplest way might be that you just remove/comment out the 2 lines and let it build a jar for you to use.
Where are the lines that actually send the part out of the way? I couldn't find what mixin those were in.
I've already compiled my own build of it already to try and fix it, I assume i just missed some code somewhere.
https://github.com/tr7zw/FirstPersonModel/blob/1.19/Shared/src/main/java/dev/tr7zw/firstperson/mixins/ModelPartMixin.java#L25 But you probably don't want to touch that, since it just might break compatibility with other mods.
This is the commit you are probably looking for df38a84#diff-83a50c262a972f3d0fcc1301e5dc7c5caf15bc581c664ec90fd5c10226062e2bR36
But looking at that, the body is never moved far away. It's only getting done to the head. Also during elytra flying, the model is not rendered at all. So possible it's more an issue with the lua script(that it doesn't check if the model is rendered at all)?
that still doesnt seem to account for the model in first person not tracking the position properly when exiting a sprint swim though
I think in general, the issue is probably the approach. You want the model to be in the right place for the camera(because your model is at a different height than steve). So just moving the camera up with the lua script or some other mod should do the entire trick? Left/Right should be fine(as long as the head is centered) and back/forth is already a setting.
hmm though, disabling the code for checking when i'm swimming doesn't seem to solve the issue for some reason, and even with iris disabled the view still seems to glitch a little bit
Aha, I think I know whats going on. That might be the positions used for the shadow calculations? What happens when you press f6/use f5 mode?
wait a minute! when i disable the first person model and look at the coordinate output, with shaders off it stays in place but when they're turned on the water waving and refraction seems to be messing with the coordinate values
My situation is a lot more complex than that because the body actually gets rotated around in the animations themselves which affects the head position, moving it forwards and backwards as well as up and down dynamically.
Also not sure why with shaders on the position gets sent like over 2 million blocks away on one of the frames
and the issue seems to be specifically with exiting a sprint swim, all the other cases seem to work perfectly aside from that one thing
I mean, you might be a lot better off just making a compatibility hook https://github.com/tr7zw/FirstPersonModel/blob/1.19/Shared/src/main/java/dev/tr7zw/firstperson/api/PlayerOffsetHandler.java
and the issue seems to be specifically with exiting a sprint swim, all the other cases seem to work perfectly aside from that one thing
when entering/exiting swim mode, the model does a tilt animation. Possible that it messes some other logic up(since the player model does fully get rendered when exiting, but isn't straight up yet).
that's kind of strange though because it only happens in first person, not third person and ive compiled a specific version that doesnt hide the body
eh though i kinda give up debugging for now, there's so many factors to this that i don't even know where to continue.
The issue doesn't seem to be linked directly to this mod though as far as I can tell from what I've checked, it's likely one of those nightmare incompatiblity scenarios where various mods clashing together cause a single issue...
Closing issue for now, I'll reopen if I find something else that might be causing it in here. Thanks for trying to help though!