Fix locked chests' formspec

This commit is contained in:
LeMagnesium 2015-09-06 14:09:17 +02:00
parent 5aaa915196
commit 9091d61132
1 changed files with 6 additions and 10 deletions

View File

@ -1803,8 +1803,8 @@ minetest.register_node("default:torch", {
})
local chest_formspec =
"size[8,9]"..
default.gui_slots ..
"size[8,9]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
"list[current_name;main;0,0.3;8,4;]" ..
@ -1812,8 +1812,7 @@ local chest_formspec =
"list[current_player;main;0,6.08;8,3;8]" ..
"listring[current_name;main]" ..
"listring[current_player;main]" ..
default.get_hotbar_bg(0, 4.85) ..
default.get_hotbar_bg(0, 6.85)
default.get_hotbar_bg(0,4.85)
local function get_locked_chest_formspec(pos)
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
@ -1823,12 +1822,11 @@ local function get_locked_chest_formspec(pos)
default.gui_bg_img ..
default.gui_slots ..
"list[nodemeta:".. spos .. ";main;0,0.3;8,4;]"..
"list[current_player;main;0,4.85;8,4;]"..
"list[current_player;main;0,4.85;8,1;]"..
"list[current_player;main;0,6.08;8,3;8]" ..
"listring[nodemeta:" .. spos .. ";main]" ..
"listring[current_player;main]" ..
default.get_hotbar_bg(0, 4.85) ..
default.get_hotbar_bg(0, 5.85)
default.get_hotbar_bg(0,4.85)
return formspec
end
@ -1875,7 +1873,6 @@ minetest.register_node("default:chest", {
end,
})
minetest.register_node("default:chest_locked", {
description = "Locked Chest",
tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
@ -1883,6 +1880,7 @@ minetest.register_node("default:chest_locked", {
paramtype2 = "facedir",
groups = {choppy = 2, oddly_breakable_by_hand = 2},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer)
@ -1949,7 +1947,6 @@ minetest.register_node("default:chest_locked", {
minetest.log("action", player:get_player_name() ..
" takes stuff from locked chest at " .. minetest.pos_to_string(pos))
end,
on_rightclick = function(pos, node, clicker)
local meta = minetest.get_meta(pos)
if has_locked_chest_privilege(meta, clicker) then
@ -1960,7 +1957,6 @@ minetest.register_node("default:chest_locked", {
)
end
end,
on_blast = function() end,
})