-
-
Save ahkok/38e05e8f8208496fe317825ddb163c9a to your computer and use it in GitHub Desktop.
simple mineteserver `make it do something` worldmod.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
By default, minetestserver is idle until a player connects, so | |
we trigger it to generate some landscape for us which should | |
nicely cause it to do some actual work. | |
Afterwards, shut down the server gracefully. | |
--]] | |
local msgs = { | |
[core.EMERGE_CANCELLED] = "cancelled", | |
[core.EMERGE_ERRORED] = "error", | |
[core.EMERGE_FROM_MEMORY] = "loaded from memory", | |
[core.EMERGE_FROM_DISK] = "loaded from disk", | |
[core.EMERGE_GENERATED] = "generated" | |
} | |
minetest.after(0, function() | |
minetest.emerge_area({x = -100, y = -100, z = -100}, | |
{x = 100, y = 100, z = 100}, | |
function(blockpos, action, calls_remaining, param) | |
print("BBT: blockpos " .. minetest.pos_to_string(blockpos) .. ": " .. msgs[action]) | |
end) | |
print("BBT: minetestserver running OK and executing tasks") | |
minetest.after(5, function() | |
print("BBT: minetestserver shutting down") | |
minetest.request_shutdown("Automatic shutdown") | |
end) | |
end) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment