make queen bee turning a bit more stable #460
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Heya! Is me again. I took a look at the rotation issue (#165) you requested help on. I'm by no means extremely versed in mod development these days, but this is the best I could do without modifying the Queen Bee's model or creating a mixin.
The issue seems to mostly stem from the Queen Bee not having a dedicated head in its model.
This solution only tries to turn towards the player's position every 20 ticks and stays locked on that position for the full duration. Minecraft waits 10 ticks for the head to be stable before rotating the body, then takes 10 ticks to rotate the body.
I had also experimented with manually updating the body rotation to match the head rotation in the queen bee's tick() function, but that looked pretty jittery compared to Minecraft's built-in body rotation handler.
It's possible there's a better solution, but this is the best I've got. Notably, it's not incredibly snappy and it'll rotate twice (the body will spin to accommodate the head for the first 40 degrees or so, then stop until the head is stable for 10 ticks) if the turn is far enough.
Also prevented the look location from updating if the player has moved less than 2 blocks so players can get a closer look at what she's holding without her spinning the item away from them.