fix bones formspec

This commit is contained in:
FaceDeer 2020-02-02 22:13:32 -07:00
parent ad319c50a3
commit 6deb010475
2 changed files with 13 additions and 1 deletions

View File

@ -106,6 +106,17 @@ bones_loot.get_loot = function(pos, loot_type, max_stacks, exclusive_loot_type)
return items return items
end end
local bones_formspec =
"size[8,9]" ..
"list[current_name;main;0,0.3;8,4;]" ..
"list[current_player;main;0,4.85;8,1;]" ..
"list[current_player;main;0,6.08;8,3;8]" ..
"listring[current_name;main]" ..
"listring[current_player;main]"
if minetest.get_modpath("default") then
bones_formspec = bones_formspec .. default.get_hotbar_bg(0,4.85)
end
bones_loot.place_bones = function(pos, loot_type, max_stacks, infotext, exclusive_loot_type) bones_loot.place_bones = function(pos, loot_type, max_stacks, infotext, exclusive_loot_type)
minetest.set_node(pos, {name="bones:bones", param2 = math.random(1,4)-1}) minetest.set_node(pos, {name="bones:bones", param2 = math.random(1,4)-1})
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -113,6 +124,7 @@ bones_loot.place_bones = function(pos, loot_type, max_stacks, infotext, exclusiv
infotext = S("Someone's old bones") infotext = S("Someone's old bones")
end end
meta:set_string("infotext", infotext) meta:set_string("infotext", infotext)
meta:set_string("formspec", bones_formspec)
if max_stacks and max_stacks > 0 then if max_stacks and max_stacks > 0 then
local loot = bones_loot.get_loot(pos, loot_type, max_stacks, exclusive_loot_type) local loot = bones_loot.get_loot(pos, loot_type, max_stacks, exclusive_loot_type)

View File

@ -1,4 +1,4 @@
name = bones_loot name = bones_loot
description = An API that allows bones to be placed procedurally with randomly generated loot description = An API that allows bones to be placed procedurally with randomly generated loot
depends = bones depends = bones
optional_depends = dungeon_loot, intllib optional_depends = dungeon_loot, intllib, default