-
-
Notifications
You must be signed in to change notification settings - Fork 45
Improvements to the current Flick Stick implementation #626
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
base: multiversion/dev
Are you sure you want to change the base?
Improvements to the current Flick Stick implementation #626
Conversation
I would prefer if when turning the Animation timer into 1 it displayed "None" or something akin to that, but I do not know how to implement that. |
I can't seem to find a way to get the camera's yaw. I'm guessing it would be within the Or it could be within |
yaw in yRot in mojmap |
.formatValue on the controller |
I'll try using ticksToMillis, but that requires me to implement a check that turns off the animation when it is 0, since 1 tick is 50ms. |
Got the toggle working properly, now it's just getting the flick stick working as planned. EDIT: And changing the strings, since they mention ticks. |
I'm guessing the camera's yRot? The player also has one, being inherited from entity, but I'm unsure as to which... |
I have found As for the variable Also, does |
I'm really not sure as to how to get the player's camera, since import net.minecraft.client.Camera
// Other imports
public class InGameInputHandler {
private final Camera camera
... Doesn't seem to work. I'm guessing I have to initialize the camera to something, like most of the things inside the function |
It indeed needed to be declared outside. I am currently trying to test what happens if I use the player's yHeadRot instead... |
About that... It breaks the stick orientation fix (AKA the The current method described probably doesn't work for that reason, so I'll edit that out. |
So, that means we would need a way to get the original yaw, and use it as an anchor in order to turn based on |
Found the solution, turns out I was doing the calculations wrong... (oops) The formula in order to calculate the angle where the camera should be would be:
Combined with a call to `Mth.wrapDegrees()`, it would end up looking like this:This is in order to stop the camera from doing a 360 flick when switching from back-left to back-right and vice versa
|
As for implementing it, I still have a doubt: I figured out that the camera divides the movement by 15º increments, hence having to divide by 0.15, in order to disable that. TL;DR: I was right with it being a Vanilla animation.
I'm guessing it's done in an attempt to get the flick stick to snap into 90 degree angles, instead of having it flick you into the angle you held. It also disables an animation, which I am guessing is coming from Vanilla?/ 0.15 do within the player.turn() calls do? |
Sure enough, using the player's |
Got it, figured out that you needed to import Still needs testing, but it works on Fabric 1.21.7, and it works somewhat with Better Third Person (Sometimes the flick stick turns the player, but that isn't that bad). The animation also is somewhat glitchy, skipping every so often. |
Might be interesting to add the Steam Input-like Flick Stick as an option instead of replacing the old method. |
I'm not sure as to how to proceed... I've already stated that it might be interesting to add an option to re-enable the old method of Flick Stick. As for the animation glitches, those are beyond my modding knowledge, and I would need help in order to fix them.
What are your opinions in these matters, @isXander? |
Description
This Pull Request is made to attempt to fix some of the issues that the current implementation of the Flick Stick has.
I could try to add other additions, but I would probably need help implementing some. Comment if you have ideas for another feature for the Flick Stick.
Progress
as per described in my comment in issue #506This method didn't work, but I found another method.Status
Currently everything is implemented, but needs testing. I have tested it with Fabric 1.21.7 and it works. Old versions should work too, but since I can't compile all the versions, I can't test that.