-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Structure API Finalization #5669
Structure API Finalization #5669
Conversation
These methods will be subject to change in the future (e.g. EventRegister API/PR)
Developers should instead opt to manually set the current event within their Structure load methods.
This was actually not necessarily and reduces confusion/complexity in the methods.
apparently the parser doesn't do this :(
Removal of the EntryContainer class types is just guess work. You could use TypeToken to ensure the type matches the generic. I don't see the point of unsafe type casting when it could just be returning an Object and it's up to the developer to handle proper casting, rather than Skript assuming the cast would work. This is bad practice. Everything else is fine. |
The main idea was to simplify how much needed to be done to just obtain the entries. e.g. it's much simpler for the developer to just be able to do: I thought the constant specification of the type was more of an annoyance than anything, but I'd certainly like to hear other opinions :)) |
Ya I don't agree with that. Let the developer cast it rather than assumption. |
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.
My changes above and also needs to target dev/2.7 now as discussed in Discord.
TO ALL SKRIPTLANG DEVS: Please don't update this pull request to master, until Pickle changes the target branch to dev/2.7 to avoid making Pickle do revisions.
* Adds new ScriptData to this Script's data map. | ||
* @param data The data to add. | ||
*/ | ||
@ApiStatus.Experimental |
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.
If you expect these methods to change it would probably have been better to put them in some kind of 'unsafe' class, rather than putting warnings on these.
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.
These are expected to change in #5552 which is now targeting 2.8 (hence these annotations)
I'm not expecting a big impact (if any) on developers
This is a breaking change (within 2.7, these methods did not exist in 2.6)
This reverts commit e3bf070.
This restores the behavior of the method loading the script even if it wasn't previously loaded.
With some generic changes to prevent additional casting for users of generic classes like List
Description
This PR aims to make the final changes before the Structure API is "officially released" with 2.7
Changes:
If there any other suggested changes we want to make, let me know!
Target Minecraft Versions: any
Requirements: none
Related Issues: none