QuiltMC / quilt-standard-libraries

A set of libraries to assist in making Quilt mods.
Apache License 2.0
152 stars 85 forks source link

Add support for BowExtensions to modify FOV like the vanilla bow. #340

Closed senkosan420 closed 9 months ago

senkosan420 commented 1 year ago

Since drawing an item that implements BowExtensions doesn't change the FOV, I thought it would be nice to add it. (Also ignore the first two commits, I originally didn't create the file properly)

senkosan420 commented 1 year ago

I don't know how to change the code now but the method shouldn't be static, sorry.

soir20 commented 1 year ago

You can update it by git pushing to the BowExtensionsFov branch in your fork of this repository. GitHub will update this PR automatically.

senkosan420 commented 1 year ago

Looks good to me. This was also suggested as a PR to Netherite Plus (OroArmorModding/Netherite-Plus-Mod#144).

There is a problem with this method though, and it's that it doesn't support the getCustomPullProgress method. Which will leads to the zoom being offset, and I have confirmed this through my own testing.

OroArmor commented 1 year ago

Ah I was wondering about that, but I assumed the getTicksUsing would work for that.

senkosan420 commented 12 months ago

This isn't the right solution.

getCustomPullProgress does not have to behave like the vanilla; it can scale however it likes with time (for example, a bow could only hold its max charge for 20 ticks before losing strength). If we provide that flexibility in the API, then the FoV rendering must to be equally flexible.

So, one of two paths needs to be taken:

* Remove getCustomPullProgress (a breaking change), and replace it with `maxDrawDuration`, which always behaves like the normal bow with a faster/slower draw time (however maybe the ItemStack could be passed in to the method for some flexibility)

* Mixin getSpeed to use a custom FoV interpolation based only on `getCustomPullProgress`

https://github.com/Nemuri404/quilt-standard-libraries/commit/a21357f3c9549601eee8ce302b5ace8d3a35f941

senkosan420 commented 10 months ago

Well, now what...?

FirstMegaGame4 commented 9 months ago

Wait why did you closed it? OroArmor proably waited for the QSL 1.20.2 to release to merge this after.