2020-02-14 16:21:21 +03:00
|
|
|
#!/bin/sh
|
|
|
|
# creates an example/test map.sqlite
|
|
|
|
|
|
|
|
MTDIR=/tmp/mt
|
|
|
|
WORLDDIR=${MTDIR}/worlds/world
|
|
|
|
WORLDMODDIR=${WORLDDIR}/worldmods
|
|
|
|
|
|
|
|
rm -rf ${WORLDDIR}
|
|
|
|
mkdir -p ${WORLDMODDIR}/mapgen
|
|
|
|
|
2020-06-12 16:15:19 +03:00
|
|
|
cat <<EOF > world.mt
|
|
|
|
gameid = minetest
|
|
|
|
backend = sqlite3
|
|
|
|
creative_mode = false
|
|
|
|
enable_damage = false
|
|
|
|
player_backend = files
|
|
|
|
EOF
|
2020-02-14 16:21:21 +03:00
|
|
|
|
|
|
|
cat <<EOF > ${WORLDMODDIR}/mapgen/init.lua
|
|
|
|
local function execute_mapgen(callback)
|
|
|
|
local pos1 = { x=-100, y=-100, z=-100 }
|
|
|
|
local pos2 = { x=100, y=100, z=100 }
|
|
|
|
minetest.emerge_area(pos1, pos2, function(blockpos, _, calls_remaining)
|
|
|
|
minetest.log("action", "Emerged: " .. minetest.pos_to_string(blockpos))
|
|
|
|
if calls_remaining > 0 then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
callback()
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
|
|
|
|
minetest.after(1, function()
|
|
|
|
execute_mapgen(function()
|
|
|
|
minetest.request_shutdown("success")
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod 777 ${MTDIR} -R
|
|
|
|
docker run --rm -i \
|
|
|
|
-v ${CFG}:/etc/minetest/minetest.conf:ro \
|
|
|
|
-v ${MTDIR}:/var/lib/minetest/.minetest \
|
2020-06-12 16:12:31 +03:00
|
|
|
registry.gitlab.com/minetest/minetest/server:5.2.0
|
2020-02-14 16:21:21 +03:00
|
|
|
|
|
|
|
cp ${WORLDDIR}/map.sqlite .
|