mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-15 23:10:31 +01:00
Fix locked chests' formspec
This commit is contained in:
parent
5aaa915196
commit
9091d61132
|
@ -1803,8 +1803,8 @@ minetest.register_node("default:torch", {
|
||||||
})
|
})
|
||||||
|
|
||||||
local chest_formspec =
|
local chest_formspec =
|
||||||
"size[8,9]"..
|
"size[8,9]" ..
|
||||||
default.gui_slots ..
|
default.gui_bg ..
|
||||||
default.gui_bg_img ..
|
default.gui_bg_img ..
|
||||||
default.gui_slots ..
|
default.gui_slots ..
|
||||||
"list[current_name;main;0,0.3;8,4;]" ..
|
"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]" ..
|
"list[current_player;main;0,6.08;8,3;8]" ..
|
||||||
"listring[current_name;main]" ..
|
"listring[current_name;main]" ..
|
||||||
"listring[current_player;main]" ..
|
"listring[current_player;main]" ..
|
||||||
default.get_hotbar_bg(0, 4.85) ..
|
default.get_hotbar_bg(0,4.85)
|
||||||
default.get_hotbar_bg(0, 6.85)
|
|
||||||
|
|
||||||
local function get_locked_chest_formspec(pos)
|
local function get_locked_chest_formspec(pos)
|
||||||
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
|
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_bg_img ..
|
||||||
default.gui_slots ..
|
default.gui_slots ..
|
||||||
"list[nodemeta:".. spos .. ";main;0,0.3;8,4;]"..
|
"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]" ..
|
"list[current_player;main;0,6.08;8,3;8]" ..
|
||||||
"listring[nodemeta:" .. spos .. ";main]" ..
|
"listring[nodemeta:" .. spos .. ";main]" ..
|
||||||
"listring[current_player;main]" ..
|
"listring[current_player;main]" ..
|
||||||
default.get_hotbar_bg(0, 4.85) ..
|
default.get_hotbar_bg(0,4.85)
|
||||||
default.get_hotbar_bg(0, 5.85)
|
|
||||||
return formspec
|
return formspec
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1875,7 +1873,6 @@ minetest.register_node("default:chest", {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node("default:chest_locked", {
|
minetest.register_node("default:chest_locked", {
|
||||||
description = "Locked Chest",
|
description = "Locked Chest",
|
||||||
tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
|
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",
|
paramtype2 = "facedir",
|
||||||
groups = {choppy = 2, oddly_breakable_by_hand = 2},
|
groups = {choppy = 2, oddly_breakable_by_hand = 2},
|
||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
|
is_ground_content = false,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
|
||||||
after_place_node = function(pos, placer)
|
after_place_node = function(pos, placer)
|
||||||
|
@ -1949,7 +1947,6 @@ minetest.register_node("default:chest_locked", {
|
||||||
minetest.log("action", player:get_player_name() ..
|
minetest.log("action", player:get_player_name() ..
|
||||||
" takes stuff from locked chest at " .. minetest.pos_to_string(pos))
|
" takes stuff from locked chest at " .. minetest.pos_to_string(pos))
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_rightclick = function(pos, node, clicker)
|
on_rightclick = function(pos, node, clicker)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if has_locked_chest_privilege(meta, clicker) then
|
if has_locked_chest_privilege(meta, clicker) then
|
||||||
|
@ -1960,7 +1957,6 @@ minetest.register_node("default:chest_locked", {
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_blast = function() end,
|
on_blast = function() end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user