-
-
Notifications
You must be signed in to change notification settings - Fork 379
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
Script development auto reloading on save #7464
base: dev/feature
Are you sure you want to change the base?
Script development auto reloading on save #7464
Conversation
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.
The entry validator is a parameter for registering the structure. Is there a reason you aren't/can't just do that?
Oh no. Didn't see that. Interesting way of setting the EntryValidator. I still believe this overriding implementation is good so it can be changed dynamically. |
If it needs to be done dynamically (which seems unlikely), I think it would be better for the developer to manage it in init themselves |
You'd have to set the EntryValidator by getting the StructureData then the StructureInfo, and that would override the existing EntryValidator if it was also needed because the Structure init is called before the implemented Structure. |
They can simply store the EntryValidator on the class and validate it (receive an entry container) themselves in the overridden init. It does't necessarily have to be the internal one. This is the common approach for addon developers who implement these for Sections. |
I'd rather see this as an addon or script personally |
Ya that's one way of doing it. It probably should've been an overriding method from the start to avoid storing it in ram, like Njol did with everything. Changers for example. |
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 was interested in trying this, but ran into a few minor issues.
We don't want to be creating an EntryValidator every time the Structure is parsed. I don't think storing it in RAM is anything to be concerned about (or how much memory that might be - it won't be that much). Handling the validation through the syntax info is fine as-is. |
It'll be needed at parse time since that's when the Structure is created and parsed. Once the EntryValidator is used during parsing, it'll be garbage collected. |
Placing in draft, as the parsing doesn't support String lists. |
add it |
Description
Target Minecraft Versions: any
Requirements: none
Related Issues: #4313