Chain#16
Conversation
|
I updated the dev branch to include the commits I had pushed to main. Can you pull the dev branch in yours such that I can review changes easier please? |
|
Hey @TechnicallyCoded, I merged your dev branch onto my chain branch. |
|
I don't have much against these changes given that upgrading to the new signature changes is an opt-in process.
|
True, but it is very useful syntactic sugar. You often run into cases where you might have a callback... based on an if statement later in code. This syntactic sugar is super useful for maintaining order and readability in those cases. For example, in WeaponMechanics, I create a reload task for reloading the weapon. Then I might add firearm actions to it, depending on the weapon.
Object creation in java is expensive when compared to something like a standard function call, or math... but it is one of the most optimized processes in the language. I'd argue that adding 1 more object here won't create a measurable difference in plugins. BUT, you gave me an alternative idea... What if the
Will do! 👍 I'll wait on your comment on the new methods in WrappedTask to make any changes |
|
So I did make those doc changes... I don't really like the idea of adding to |
|
One interesting thing about adding to |
|
probably use The issue with this method is that it is a big change and is missing some obvious things, like callbacks onto an object. (e.g. load file async, act on the contents sync) |
|
(and anyway, you already have a couple futures in your base code... that is a breaking change) |
|
I will merge this onto main once a few of my other changes from dev are well tested |
|
If you publish a -SNAPSHOT build, I can run some tests easier as well |
Often, people want to add a callback for after a task is completed. This is done often enough that there are libs. Unfortunately, with all of the new methods for Folia support, all of these libraries are useless for folia. I noticed that you already have some support for this:
But we don't have those future instances on the
runLatermethods. This PR adds those methods. Quick notes:runTimermethods, because I figured it didn't make much sense. But I am open to adding that to this PR if you'd like.devbranch, since it seems you prefer PRs to go there.Thanks very much!
Fixes #14