-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Sign update #5797
base: dev/feature
Are you sure you want to change the base?
Sign update #5797
Conversation
bd134d0
to
3f08853
Compare
Changed to a functional interface to support:
Tests failing is not related to this pull request. Fix at #6433 |
…ript into feature/line-signs
src/main/java/ch/njol/skript/classes/data/BukkitEventValues.java
Outdated
Show resolved
Hide resolved
|
||
void setLine(int line, @NotNull String value); | ||
|
||
static void setLine(SetSignLine<Integer, String> setLineMethod, int line, String value) { |
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 is the point of these static methods? Why not just call setLineMethod.setLine(line, value)
directly? Rather than all of these interfaces, I think it would be better just to have a Spigot and Adventure implementations of an interface with set/get methods. The Adventure implementation can handle the string->component conversions.
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.
It's required to be static, because that's how FunctionalInterface works. One method must be static.
Adventure doesn't exist on Spigot, so you can't rely on Adventure to handle the string to component conversions as the method doesn't exist.
It's a functional interface because AdventureSetSignLine has to be a separate class due to the classes not existing and needing to be statically initialized.
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.
There should be no problem to call the interface methods directly? There's no requirement for there be a static method.
If the Adventure implementation is used only on Paper, I don't see why it would be an issue to handle the component parsing in the interface implantation rather than the syntax's change method. I think the implementation right now is somewhat over complicated for what we need
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.
I don't agree with it being more complex. It's making it simpler to read. You have to deal with all the provided methods I posted #5797 (comment)
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.
I think it's unnecessary for the Adventure interface to be something we're specifically checking for in change. There should just be an implementation for Adventure of SetSignLine that handles the component conversion (that way adventure doesn't need passed/handled as it's own parameter). Additionally, I'm still not seeing why these static methods are necessary. If you have the interface object, why can't you just call the method it has directly?
…ript into feature/line-signs
Description
Notes:
Target Minecraft Versions: any
Requirements: Paper is optional
Related Issues: #4576 #5778