-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Skript cannot save classes imported by skript-reflect. #56
Comments
By default, no java objects (anything returned from a method, constructor or field call) can be saved. This is because all java objects are wrapped in an ObjectWrapper, which is a registered skript-reflect type (named However, to allow using java objects in regular Skript syntax, skript-reflect will automatically convert a Skript also has a This is where the problem arises: Skript says it can serialize all This issue should be fixed in Skript, because Skript having a number type with a serializer registered says it'll be able to serialize all numbers, not just some. If you test this on I might be able to do something about this (meaning I might be able to print that warning when reloading your script), but only in some cases, so I don't think I'll spend time on this soon (for myself if I change my mind in the future: return type of ExprJavaCall can be derived, if the java call is known: target object return type + method name + known signature gives a java member match, at runtime must be instance of that member return type, or for constructor even easier). While you can mark variables in Skript as unsaved using the SkriptLang/Skript#1049 talks about this stuff, but it also mentions that the current solution (editing database's variable pattern) isn't great. |
Thanks for responding, I've decided to just try and make functions to convert them to and from strings and just store those instead. Hopefully that works. |
Describe the bug
Skript cannot serialize imported classes even if they implement serializable. (Only tested on BigDecimal and MathContext)
To reproduce
After doing this errors appear and skript will be unable to save any variables.
Expected behavior
Expected to be able to save java's BigDecimal class to variables.csv but was instead unable to save anything.
Screenshots
Server information
The text was updated successfully, but these errors were encountered: