-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
make bookshelf power configurable and refresh enchantment hint of menu after editing bookshelf power #12345
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: main
Are you sure you want to change the base?
Conversation
Welcome to paper 🥳 It appears you commit / generate a whole slew of completely unrelated and invalid changes. |
I would suggest rebasing this PR or creating a new one |
I don't want to create a new one because this is my first PR and its number is 12345. I will look into rebasing the codes |
8248809
to
338303f
Compare
wait. it is not done. I will inform it is ready for review when I end all of rebase procedure |
64bc304
to
597f186
Compare
I did it. I am now the master of rebase. I am ready for review. |
@lynxplay @electronicboy |
597f186
to
894631f
Compare
wait I will reopen PR right now. it was accident |
23aa125
to
7adadc3
Compare
I am not sure if I do it right. waiting for review. |
THIS IS PULL REQEUST #12345 AND I LOVE IT (soory this might be off topic but i had to say it) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I find a bit unfortunate is that changing the bonus power in the event basically makes any changes in the offers redundant, as you reroll these anyways.
I don't know if there is a particularly clean way to fix this. I personally can also only think of one way to fix this, but I understand it is not very advantageous:
- The introduction of a new
RetrieveItemEnchantPowerEvent
, which allows for setting the enchantment bonus before the offers are even put into consideration.
Therefore, the actual PrepareItemEnchantEvent could stay unmodified and enchantment offer modifications would still work as intended.
Of course, before you make this change, I'd like a Paper developer to confirm that this is an acceptable step to take, because I am not sure myself either.
I will fix the build error as soon as possible. |
@Strokkur424 your idea is previous my idea. when I discussed this feature at Paper discord's paper-dev channel, I suggest that structure but lynxplay adviced me that, in his opinion, making the event just set value is not good idea (the discord dialog link that starts to discuss this feature with lynxplay: https://discord.com/channels/289587909051416579/555462289851940864/1347917294382219417) So I should change original PrepareItemEnchantEvent. Yeah. I also think it would be good if offers method have more role. and I think "why doesn't it process the values of offers member field at constructor point with considering the bonus value is changed? it would be easy way to handle the logic when making an event." but that is not really feasible. because paper-api package can not import the code from paper-src. (I don't know the principle why it should be like it.) Finally my decision is making bonus member field non final instead of making new event to set the bonus value and to include the other fields of PrepareItemEnchantEvent, checking the value and refreshing the enchantment hint after PrepareItemEnchantEvent calls. (it is now structure.) |
Well, we still need some way to modify the new enchantment suggestions, because this is a valid thing a plugin would do:
Not entirely sure how this can be achieved cleanly though. |
@Strokkur424 |
I am sorry I haven't managed to read through this for so long.
which I still believe to hold true. |
7adadc3
to
2add8da
Compare
@lynxplay Yeah. and I don't make another event. it is a simple quality-of-life feature update for users who want an enchantment offers of specific level of bonus. I fix compile error of last commit. |
2add8da
to
4a66e57
Compare
I retry same fix. before this, it is not properly updated. now this PR should pass the test. |
…u after editing bookshelf power
…t of menu after editing bookshelf power" This reverts commit b56273b.
Introduces a new API method that allows plugins to simulate the rolling process of an enchantment table for enchantment offers. This is specifically useful to "reroll" an enchantment tables offers during the PrepareItemEnchantEvent to e.g. change the bookshelf bonus or seed. Co-authored-by: I-am-DDang_ <[email protected]>
4a66e57
to
bc11611
Compare
No description provided.