40 lines
1.2 KiB
Lua
40 lines
1.2 KiB
Lua
--Extreme Survival created by maikerumine
|
|
-- Minetest 0.4.13 mod: "Extreme Survival"
|
|
-- namespace: es
|
|
--version 1.8
|
|
--https://github.com/maikerumine
|
|
|
|
--License:
|
|
--~~~~~~~~
|
|
--Code:
|
|
--(c) Copyright 2015 maikerumine; modified zlib-License
|
|
--see "LICENSE.txt" for details.
|
|
|
|
--Media(if not stated differently):
|
|
--(c) Copyright (2014-2015) maikerumine; CC-BY-SA 3.0
|
|
|
|
es = {}
|
|
|
|
|
|
--MAPFIX CODE (USE WHEN DARK SHADOWS FORM, TYPE /MAPFIX)
|
|
minetest.register_chatcommand("mapfix", {
|
|
params = "<size>",
|
|
description = "Recalculate the flowing liquids of a chunk",
|
|
func = function(name, param)
|
|
local pos = minetest.get_player_by_name(name):getpos()
|
|
local size = tonumber(param) or 40
|
|
if size > 50 and not minetest.check_player_privs(name, {server=true}) then
|
|
return false, "You need the server privilege to exceed the radius of 50 blocks"
|
|
end
|
|
local minp, maxp = {x = math.floor(pos.x - size), y = math.floor(pos.y - size), z = math.floor(pos.z - size)}, {x = math.ceil(pos.x + size), y = math.ceil(pos.y + size), z = math.ceil(pos.z + size)}
|
|
local vm = minetest.get_voxel_manip()
|
|
vm:read_from_map(minp, maxp)
|
|
vm:calc_lighting()
|
|
vm:update_liquids()
|
|
vm:write_to_map()
|
|
vm:update_map()
|
|
return true, "Done."
|
|
end,
|
|
})
|
|
|