mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-22 15:33:00 +00:00
//sstack: add human-readable approx volume to output
This commit is contained in:
parent
fc2444c5cd
commit
82c1ebd42c
1 changed files with 7 additions and 0 deletions
|
@ -20,8 +20,15 @@ worldedit.register_command("sstack", {
|
||||||
table.insert(result, "(empty)")
|
table.insert(result, "(empty)")
|
||||||
else
|
else
|
||||||
for i,item in ipairs(worldeditadditions.sstack[name]) do
|
for i,item in ipairs(worldeditadditions.sstack[name]) do
|
||||||
|
local volume = worldedit.volume(item[1], item[2])
|
||||||
|
local volume_text = worldeditadditions.format.human_size(volume, 2)
|
||||||
|
if volume > 1000 then volume_text = "~"..volume_text end
|
||||||
|
|
||||||
table.insert(result, i)
|
table.insert(result, i)
|
||||||
table.insert(result, ": ")
|
table.insert(result, ": ")
|
||||||
|
|
||||||
|
table.insert(result, volume_text)
|
||||||
|
table.insert(result, " nodes - ")
|
||||||
table.insert(result, worldeditadditions.vector.tostring(item[1]))
|
table.insert(result, worldeditadditions.vector.tostring(item[1]))
|
||||||
table.insert(result, " - ")
|
table.insert(result, " - ")
|
||||||
table.insert(result, worldeditadditions.vector.tostring(item[2]))
|
table.insert(result, worldeditadditions.vector.tostring(item[2]))
|
||||||
|
|
Loading…
Reference in a new issue