mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-11-08 08:23:59 +01:00
filter: allow to take items out of locked chests if same owner (#193)
This commit is contained in:
parent
f9f436fd7e
commit
c57a35d5bd
@ -36,7 +36,7 @@ local function get_chest_formspec(pos)
|
|||||||
pipeworks.button_on
|
pipeworks.button_on
|
||||||
}
|
}
|
||||||
)..pipeworks.button_label
|
)..pipeworks.button_label
|
||||||
|
|
||||||
return formspec
|
return formspec
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
local sound = open_chests[pn].sound
|
local sound = open_chests[pn].sound
|
||||||
local swap = open_chests[pn].swap
|
local swap = open_chests[pn].swap
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
|
|
||||||
open_chests[pn] = nil
|
open_chests[pn] = nil
|
||||||
for k, v in pairs(open_chests) do
|
for k, v in pairs(open_chests) do
|
||||||
if v.pos.x == pos.x and v.pos.y == pos.y and v.pos.z == pos.z then
|
if v.pos.x == pos.x and v.pos.y == pos.y and v.pos.z == pos.z then
|
||||||
@ -71,13 +71,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
end
|
end
|
||||||
minetest.after(0.2, function()
|
minetest.after(0.2, function()
|
||||||
minetest.swap_node(pos, { name = "default:" .. swap, param2 = node.param2 })
|
minetest.swap_node(pos, { name = "default:" .. swap, param2 = node.param2 })
|
||||||
|
|
||||||
-- Pipeworks notification
|
-- Pipeworks notification
|
||||||
pipeworks.after_place(pos)
|
pipeworks.after_place(pos)
|
||||||
end)
|
end)
|
||||||
minetest.sound_play(sound, {gain = 0.3, pos = pos, max_hear_distance = 10})
|
minetest.sound_play(sound, {gain = 0.3, pos = pos, max_hear_distance = 10})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Pipeworks Switch
|
-- Pipeworks Switch
|
||||||
if pipeworks.may_configure(pos, player) and not fields.quit then
|
if pipeworks.may_configure(pos, player) and not fields.quit then
|
||||||
fs_helpers.on_receive_fields(pos, fields)
|
fs_helpers.on_receive_fields(pos, fields)
|
||||||
@ -142,6 +142,7 @@ override_protected = {
|
|||||||
end
|
end
|
||||||
return inv:room_for_item("main", stack)
|
return inv:room_for_item("main", stack)
|
||||||
end,
|
end,
|
||||||
|
input_inventory = "main",
|
||||||
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
|
connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
|
||||||
},
|
},
|
||||||
after_dig_node = pipeworks.after_dig
|
after_dig_node = pipeworks.after_dig
|
||||||
@ -191,9 +192,9 @@ override = {
|
|||||||
after_dig_node = pipeworks.after_dig
|
after_dig_node = pipeworks.after_dig
|
||||||
}
|
}
|
||||||
--[[local override_common = {
|
--[[local override_common = {
|
||||||
|
|
||||||
}
|
}
|
||||||
for k,v in pairs(override_common) do
|
for k,v in pairs(override_common) do
|
||||||
override_protected[k] = v
|
override_protected[k] = v
|
||||||
override[k] = v
|
override[k] = v
|
||||||
end]]
|
end]]
|
||||||
|
Loading…
Reference in New Issue
Block a user