-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add proof of concept for blocks callback #15999
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
base: master
Are you sure you want to change the base?
Conversation
I'll try testing this later. Edit: I took a quick look at the API and am confused by these modes of operation - both appear to clear objects and what if I don't want to clear anything? |
Related? #14723 (comment) |
I don't know if is tabstable now. I reused |
Ok, is testable. |
I'm not sure what this would be useful for except for emulating something like |
@sfan5 Yes, similar to calling |
@sfence works well for my use case so I'd be happy with this alone merged. I wouldn't mind if api proposed by sfan5 was implemented though #14723 (comment) @sfan5 there's no other way to tell which blocks are loaded that I'm aware of, unless it's blind bruteforce status checks so this PR is an improvement IMO. |
I'm aware, but there would be cleaner API designs to achieve that. "Someone could use it to work around the lack of a proper API" is not the measure we should be using. |
There will certainly be users for an API to iterate over all emerged blocks. The doc should probably include a warning about the performance implications. (Idk if the proposed API in its current form is ideal. I'll wait for more input from other people.) You could also consider to spread the execution over multiple server steps, to avoid the lag spike.
For clearobject-like (or also lbm once) functionality, we could also add an API to get the old timestamp of each activated block. (I would like to have this.) (This doesn't cover the usecase where you just want to iterate over your whole map. So it's not an either-or situation.) |
Delivered from #14138.
Proof of concept for allowing modders to apply Lua callback to all loaded/loadable mapblocks.
Have the potential to be used for some updating, emulating some environment things like Exile game does.
@kromka-chleba
Test: