-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Feature: Home & Unstable scroll Durability & Improvements. #112
Feature: Home & Unstable scroll Durability & Improvements. #112
Conversation
…configurations, storage, world, all vane
…g files. Not Implemented: Texture reloading etc.
…aggregate the errors per yaml file.
… of lang files. Not Implemented: Texture reloading etc.
… dropping from inventory within a cooldown period.
# Conflicts: # build.gradle.kts
77e60d5
to
52f01b9
Compare
044b9dd
to
52eecc9
Compare
52eecc9
to
b557c76
Compare
Any updates on the linked papermc issue? Ah and BTW: This PR really includes a lot of commits that are now already merged. Do you want to rebase it on top of the current develop or should I also just cherry-pick from here and manually close the PR? |
I hadn't played with the PR from paper, as I didn't have experience in developing against paper forks and it's not something I had the energy to learn to be frank. They have appeared to come up with a solution, that I believe will work for our usecase (but not all the ones I outlined in the issue). It's been too long since I've played with this branch, and with the sneaking in of the namespace key changes etc, you may want to double check you actually want all of it before merging. That said, I believe the actual durability changes are good to ship. |
Perfect!
No problemo, then I will just pick the relevant commits. And maybe implement some form of mending "attenuation" for items with custom durability? |
The PR hasn't been merged yet, so if you want to check out the paper PR and test it, go ahead. Otherwise you won't be able to implement it in main yet. |
I'll make it an issue so I remember to do it when it is released. |
Thanks a lot! Merged. |
Part 1:
https://youtu.be/abrylP-zHDs
Adds default minecraft translated elements to the action bar, to improve scroll first-use experience with new players.
(I may be giving them out as kits).
Part 2:
Adds custom durability data for Home Scroll & Unstable Scroll, allowing the configuration to customize the amount of uses they have.
Also has lore showing the custom durability.
This combined with noticing that Mending tends to heal up the scroll really quickly, owing to it's low durability & Minecraft's default handing of mending, means that it is very difficult to fix the amount the item is repaired at the moment, without outright disabling it: PaperMC/Paper#7313
Technical Notes
The durability is emulated using Persistent Data nodes by monitoring the item for real durability changes, when we attempt to damage it. The lore is updated by searching for the translated component and changing it's arguments. This is how compatibility with unbreaking etc is achieved.
Whilst it does track the data, it is idempotent, so any desyncs will quickly be resolved the next time the item is used.
Changing the config retains the amount of uses the item has currently, but changes the maximum for existing items in the world.
Worst-case, it gives the user 2 extra uses of the item, if the new durability is less then the amount of total uses so far.
1 to resync the real durability, (making it 1 use remaining if the durability is invalid) and another to consume the item.
If there is 1 use remaining, we always force the real durability to 1 use remaining, this is so we can use the natural minecraft item break in regards to enchants.
This can be changed by storing the maximum when the item is first created, if desired.