You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It seems that apply(ChunkData data), before(), and after() will not be run at all if anything is returned by one of them.
To Reproduce
Open any valid Minecraft save
Select any chunk
Go to 'Tools > Change fields'
Click on 'Script'
Edit the script so any of the three functions returns something other than null. For example: return 1;
Click 'OK'
No confirmation dialog appears, nor is any log written to the log file (even with debug messages enabled). No chunk data is changed.
Expected behavior
Depending on the nature of what caused the bug, I would expect either of these behaviors:
The program executes all of the methods regularly even if a non-null value was returned by any of the methods. Or,
If any return statement is entered into any of the functions, then after clicking on 'OK' while having the "Script" tab open, an error should be shown in a message dialog and be printed to the log file. The error message should indicate that the code was not executed because it contained a return statement.
Screenshots and other files
Screenshots and log will probably not tell much since the bug is the absence of log or error message. Here's them anyway:
Environment (please complete the following information):
OS: Windows 10
Java version: 21.0.2
Version of MCA Selector: 2.4.2
Additional context
Would greatly appreciate it if there can be some sort of documentation for modifying chunk NBT via custom script. The Custom field is helpful but does not allow importing libraries, and I still haven't figured out how you're supposed to use the Script field yet 😅
The text was updated successfully, but these errors were encountered:
First of all, this is a user error :)
If a function, that is supposed to return nothing, returns something nevertheless, the code won't compile and therefore cannot be executed. I don't really think a warning is needed here as this is just based on wrong syntax assumptions, but maybe it would help some people.
Sadly there is not much documentation about the custom filter scripts yet. Apart from the custom filter tutorial I wrote a while back there is barely any, if not none. But I created a repo with some useful examples and am planning to add more filters over time and make it a place for everyone to share their examples. Currently there are a few examples for filters and modifiers. You can check them out here. And if you still need help, you can check out the Discord Server and ask for help there.
Describe the bug
It seems that
apply(ChunkData data)
,before()
, andafter()
will not be run at all if anything is returned by one of them.To Reproduce
null
. For example:return 1;
Expected behavior
Depending on the nature of what caused the bug, I would expect either of these behaviors:
null
value was returned by any of the methods. Or,return
statement is entered into any of the functions, then after clicking on 'OK' while having the "Script" tab open, an error should be shown in a message dialog and be printed to the log file. The error message should indicate that the code was not executed because it contained areturn
statement.Screenshots and other files
Screenshots and log will probably not tell much since the bug is the absence of log or error message. Here's them anyway:
mcaselector.log
mcaselector.log
Environment (please complete the following information):
Additional context
Would greatly appreciate it if there can be some sort of documentation for modifying chunk NBT via custom script. The Custom field is helpful but does not allow importing libraries, and I still haven't figured out how you're supposed to use the Script field yet 😅
The text was updated successfully, but these errors were encountered: