Version MFF.
4
.gitignore
vendored
@ -1,4 +0,0 @@
|
|||||||
## Generic ignorable patterns and files
|
|
||||||
*~
|
|
||||||
.*.swp
|
|
||||||
debug.txt
|
|
5
README.md
Normal file → Executable file
@ -5,8 +5,6 @@ More Chests
|
|||||||
|
|
||||||
This mod is a fork of 0gb.us's chests_0gb_us https://forum.minetest.net/viewtopic.php?f=11&t=4366
|
This mod is a fork of 0gb.us's chests_0gb_us https://forum.minetest.net/viewtopic.php?f=11&t=4366
|
||||||
|
|
||||||
Megaf's more_chests fixes several bugs, uses new textures and adds compatibility with [VanessaE's Pipeworks] (https://github.com/VanessaE/pipeworks) mod.
|
|
||||||
|
|
||||||
The following text was writen by 0gb.us
|
The following text was writen by 0gb.us
|
||||||
```
|
```
|
||||||
Cobble Chest:
|
Cobble Chest:
|
||||||
@ -44,4 +42,5 @@ Wifi Chest
|
|||||||
{'default:wood','default:wood','default:wood'}
|
{'default:wood','default:wood','default:wood'}
|
||||||
|
|
||||||
A wacky chest that doesn't store it's items in the usual way, but instead, stores them remotely. For that reason, all wifi chests appear to have the same inventory. Due to not actually having an inventory, wifi chests can also be mined, even when they appear to have stuff in them. Lastly, as everyone gets their own wifi account, the items you see in the wifi chest are not the same items anyone else sees. This chest's properties make it nice for keeping secrets, as well as essentially almost doubling your inventory space, if you choose to carry one with you.
|
A wacky chest that doesn't store it's items in the usual way, but instead, stores them remotely. For that reason, all wifi chests appear to have the same inventory. Due to not actually having an inventory, wifi chests can also be mined, even when they appear to have stuff in them. Lastly, as everyone gets their own wifi account, the items you see in the wifi chest are not the same items anyone else sees. This chest's properties make it nice for keeping secrets, as well as essentially almost doubling your inventory space, if you choose to carry one with you.
|
||||||
```
|
|
||||||
|
'''
|
||||||
|
0
aliases.lua
Normal file → Executable file
37
cobble.lua
Normal file → Executable file
@ -10,46 +10,35 @@ minetest.register_node("more_chests:cobble", {
|
|||||||
tiles = {"default_cobble.png", "default_cobble.png", "default_cobble.png",
|
tiles = {"default_cobble.png", "default_cobble.png", "default_cobble.png",
|
||||||
"default_cobble.png", "default_cobble.png", "cobblechest_front.png"},
|
"default_cobble.png", "default_cobble.png", "cobblechest_front.png"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1},
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||||
-- First attempt to add a way to connect to pipeworks.
|
|
||||||
tube = {
|
|
||||||
insert_object = function(pos, node, stack, direction)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
return inv:add_item("main", stack)
|
|
||||||
end,
|
|
||||||
can_insert = function(pos, node, stack, direction)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
return inv:room_for_item("main", stack)
|
|
||||||
end,
|
|
||||||
input_inventory = "main",
|
|
||||||
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
|
|
||||||
},
|
|
||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
after_place_node = function(pos, placer)
|
after_place_node = function(pos, placer)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("owner", placer:get_player_name() or "")
|
meta:set_string("owner", placer:get_player_name() or "")
|
||||||
|
--[[ meta:set_string("infotext", "Locked Chest (owned by "..
|
||||||
|
meta:get_string("owner")..")")]]
|
||||||
end,
|
end,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec",
|
meta:set_string("formspec",
|
||||||
"size[8,9]"..
|
"size[8,9]"..
|
||||||
"list[current_name;main;0,0;8,4;]"..
|
"list[current_name;main;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]")
|
"list[current_player;main;0,5;8,4;]"..
|
||||||
|
"listring[current_name;main]"..
|
||||||
|
"listring[current_player;main]")
|
||||||
|
-- meta:set_string("infotext", "Locked Chest")
|
||||||
meta:set_string("owner", "")
|
meta:set_string("owner", "")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
end,
|
end,
|
||||||
can_dig = function(pos,player)
|
can_dig = function(pos,player)
|
||||||
local meta = minetest.env:get_meta(pos);
|
local meta = minetest.get_meta(pos);
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
return inv:is_empty("main")
|
return inv:is_empty("main")
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a locked chest belonging to "..
|
" tried to access a locked chest belonging to "..
|
||||||
@ -60,7 +49,7 @@ minetest.register_node("more_chests:cobble", {
|
|||||||
return count
|
return count
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a locked chest belonging to "..
|
" tried to access a locked chest belonging to "..
|
||||||
@ -71,7 +60,7 @@ minetest.register_node("more_chests:cobble", {
|
|||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a locked chest belonging to "..
|
" tried to access a locked chest belonging to "..
|
||||||
|
0
depends.txt
Normal file → Executable file
38
dropbox.lua
Normal file → Executable file
@ -10,22 +10,7 @@ minetest.register_node("more_chests:dropbox", {
|
|||||||
tiles = {"default_chest_top.png", "default_chest_top.png", "dropbox_right.png",
|
tiles = {"default_chest_top.png", "default_chest_top.png", "dropbox_right.png",
|
||||||
"default_chest_side.png", "default_chest_side.png", "dropbox_front.png"},
|
"default_chest_side.png", "default_chest_side.png", "dropbox_front.png"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1},
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||||
-- Pipeworks
|
|
||||||
tube = {
|
|
||||||
insert_object = function(pos, node, stack, direction)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
return inv:add_item("main", stack)
|
|
||||||
end,
|
|
||||||
can_insert = function(pos, node, stack, direction)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
return inv:room_for_item("main", stack)
|
|
||||||
end,
|
|
||||||
input_inventory = "main",
|
|
||||||
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
|
|
||||||
},
|
|
||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
after_place_node = function(pos, placer)
|
after_place_node = function(pos, placer)
|
||||||
@ -39,7 +24,9 @@ minetest.register_node("more_chests:dropbox", {
|
|||||||
meta:set_string("formspec",
|
meta:set_string("formspec",
|
||||||
"size[8,9]"..
|
"size[8,9]"..
|
||||||
"list[current_name;main;0,0;8,4;]"..
|
"list[current_name;main;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]")
|
"list[current_player;main;0,5;8,4;]"..
|
||||||
|
"listring[current_name;main]" ..
|
||||||
|
"listring[current_player;main]")
|
||||||
meta:set_string("infotext", "Chest")
|
meta:set_string("infotext", "Chest")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
@ -60,23 +47,6 @@ minetest.register_node("more_chests:dropbox", {
|
|||||||
end
|
end
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
if has_locked_chest_privilege(meta, player) then
|
|
||||||
return stack:get_count()
|
|
||||||
end
|
|
||||||
local target = meta:get_inventory():get_list(listname)[index]
|
|
||||||
local target_name = target:get_name()
|
|
||||||
local stack_count = stack:get_count()
|
|
||||||
if target_name == stack:get_name()
|
|
||||||
and target:get_count() < stack_count then
|
|
||||||
return stack_count
|
|
||||||
end
|
|
||||||
if target_name ~= "" then
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
return stack_count
|
|
||||||
end,
|
|
||||||
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" moves stuff in dropbox at "..minetest.pos_to_string(pos))
|
" moves stuff in dropbox at "..minetest.pos_to_string(pos))
|
||||||
|
33
secret.lua
Normal file → Executable file
@ -8,6 +8,8 @@ end
|
|||||||
local open = "size[8,10]"..
|
local open = "size[8,10]"..
|
||||||
"list[current_name;main;0,0;8,4;]"..
|
"list[current_name;main;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]"..
|
"list[current_player;main;0,5;8,4;]"..
|
||||||
|
"listring[current_name;main]" ..
|
||||||
|
"listring[current_player;main]"..
|
||||||
"button[3,9;2,1;open;close]"
|
"button[3,9;2,1;open;close]"
|
||||||
local closed = "size[2,1]"..
|
local closed = "size[2,1]"..
|
||||||
"button[0,0;2,1;open;open]"
|
"button[0,0;2,1;open;open]"
|
||||||
@ -17,32 +19,17 @@ minetest.register_node("more_chests:secret", {
|
|||||||
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",
|
||||||
"default_chest_side.png", "default_chest_side.png", "secret_front.png"},
|
"default_chest_side.png", "default_chest_side.png", "secret_front.png"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1},
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||||
-- Pipeworks
|
|
||||||
tube = {
|
|
||||||
insert_object = function(pos, node, stack, direction)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
return inv:add_item("main", stack)
|
|
||||||
end,
|
|
||||||
can_insert = function(pos, node, stack, direction)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
return inv:room_for_item("main", stack)
|
|
||||||
end,
|
|
||||||
input_inventory = "main",
|
|
||||||
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
|
|
||||||
},
|
|
||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
after_place_node = function(pos, placer)
|
after_place_node = function(pos, placer)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("owner", placer:get_player_name() or "")
|
meta:set_string("owner", placer:get_player_name() or "")
|
||||||
meta:set_string("infotext", "Secret Chest (owned by "..
|
meta:set_string("infotext", "Secret Chest (owned by "..
|
||||||
meta:get_string("owner")..")")
|
meta:get_string("owner")..")")
|
||||||
end,
|
end,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec", open)
|
meta:set_string("formspec", open)
|
||||||
meta:set_string("infotext", "Secret Chest")
|
meta:set_string("infotext", "Secret Chest")
|
||||||
meta:set_string("owner", "")
|
meta:set_string("owner", "")
|
||||||
@ -50,12 +37,12 @@ minetest.register_node("more_chests:secret", {
|
|||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
end,
|
end,
|
||||||
can_dig = function(pos,player)
|
can_dig = function(pos,player)
|
||||||
local meta = minetest.env:get_meta(pos);
|
local meta = minetest.get_meta(pos);
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
return inv:is_empty("main")
|
return inv:is_empty("main")
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a secret chest belonging to "..
|
" tried to access a secret chest belonging to "..
|
||||||
@ -66,7 +53,7 @@ minetest.register_node("more_chests:secret", {
|
|||||||
return count
|
return count
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a secret chest belonging to "..
|
" tried to access a secret chest belonging to "..
|
||||||
@ -77,7 +64,7 @@ minetest.register_node("more_chests:secret", {
|
|||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a secret chest belonging to "..
|
" tried to access a secret chest belonging to "..
|
||||||
@ -100,7 +87,7 @@ minetest.register_node("more_chests:secret", {
|
|||||||
" takes stuff from secret chest at "..minetest.pos_to_string(pos))
|
" takes stuff from secret chest at "..minetest.pos_to_string(pos))
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if has_locked_chest_privilege(meta, sender) then
|
if has_locked_chest_privilege(meta, sender) then
|
||||||
if fields.open == "open" then
|
if fields.open == "open" then
|
||||||
meta:set_string("formspec", open)
|
meta:set_string("formspec", open)
|
||||||
|
39
shared.lua
Normal file → Executable file
@ -15,6 +15,8 @@ local function get_formspec(string)
|
|||||||
return "size[8,10]"..
|
return "size[8,10]"..
|
||||||
"list[current_name;main;0,0;8,4;]"..
|
"list[current_name;main;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]"..
|
"list[current_player;main;0,5;8,4;]"..
|
||||||
|
"listring[current_name;main]" ..
|
||||||
|
"listring[current_player;main]"..
|
||||||
"field[.25,9.5;6,1;shared;Shared with (separate names with spaces):;"..string.."]"..
|
"field[.25,9.5;6,1;shared;Shared with (separate names with spaces):;"..string.."]"..
|
||||||
"button[6,9;2,1;submit;submit]"
|
"button[6,9;2,1;submit;submit]"
|
||||||
end
|
end
|
||||||
@ -24,32 +26,17 @@ minetest.register_node("more_chests:shared", {
|
|||||||
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",
|
||||||
"default_chest_side.png", "default_chest_side.png", "shared_front.png"},
|
"default_chest_side.png", "default_chest_side.png", "shared_front.png"},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, tubedevice = 1, tubedevice_receiver = 1},
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||||
-- Pipeworks
|
|
||||||
tube = {
|
|
||||||
insert_object = function(pos, node, stack, direction)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
return inv:add_item("main", stack)
|
|
||||||
end,
|
|
||||||
can_insert = function(pos, node, stack, direction)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local inv = meta:get_inventory()
|
|
||||||
return inv:room_for_item("main", stack)
|
|
||||||
end,
|
|
||||||
input_inventory = "main",
|
|
||||||
connect_sides = {left = 1, right = 1, back = 1, front = 1, bottom = 1, top = 1}
|
|
||||||
},
|
|
||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
after_place_node = function(pos, placer)
|
after_place_node = function(pos, placer)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("owner", placer:get_player_name() or "")
|
meta:set_string("owner", placer:get_player_name() or "")
|
||||||
meta:set_string("infotext", "Shared Chest (owned by "..
|
meta:set_string("infotext", "Shared Chest (owned by "..
|
||||||
meta:get_string("owner")..")")
|
meta:get_string("owner")..")")
|
||||||
end,
|
end,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec", get_formspec(""))
|
meta:set_string("formspec", get_formspec(""))
|
||||||
meta:set_string("infotext", "Shared Chest")
|
meta:set_string("infotext", "Shared Chest")
|
||||||
meta:set_string("owner", "")
|
meta:set_string("owner", "")
|
||||||
@ -57,12 +44,12 @@ minetest.register_node("more_chests:shared", {
|
|||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
end,
|
end,
|
||||||
can_dig = function(pos,player)
|
can_dig = function(pos,player)
|
||||||
local meta = minetest.env:get_meta(pos);
|
local meta = minetest.get_meta(pos);
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
return inv:is_empty("main")
|
return inv:is_empty("main")
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a shared chest belonging to "..
|
" tried to access a shared chest belonging to "..
|
||||||
@ -73,7 +60,7 @@ minetest.register_node("more_chests:shared", {
|
|||||||
return count
|
return count
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a shared chest belonging to "..
|
" tried to access a shared chest belonging to "..
|
||||||
@ -84,7 +71,7 @@ minetest.register_node("more_chests:shared", {
|
|||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end,
|
end,
|
||||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if not has_locked_chest_privilege(meta, player) then
|
if not has_locked_chest_privilege(meta, player) then
|
||||||
minetest.log("action", player:get_player_name()..
|
minetest.log("action", player:get_player_name()..
|
||||||
" tried to access a shared chest belonging to "..
|
" tried to access a shared chest belonging to "..
|
||||||
@ -107,7 +94,7 @@ minetest.register_node("more_chests:shared", {
|
|||||||
" takes stuff from shared chest at "..minetest.pos_to_string(pos))
|
" takes stuff from shared chest at "..minetest.pos_to_string(pos))
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formspec, fields, sender)
|
on_receive_fields = function(pos, formspec, fields, sender)
|
||||||
local meta = minetest.env:get_meta(pos);
|
local meta = minetest.get_meta(pos);
|
||||||
if fields.shared then
|
if fields.shared then
|
||||||
if meta:get_string("owner") == sender:get_player_name() then
|
if meta:get_string("owner") == sender:get_player_name() then
|
||||||
meta:set_string("shared", fields.shared);
|
meta:set_string("shared", fields.shared);
|
||||||
@ -120,9 +107,9 @@ minetest.register_node("more_chests:shared", {
|
|||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'more_chests:shared',
|
output = 'more_chests:shared',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'default:wood','default:leaves','default:wood'},
|
{'group:wood','group:leaves','group:wood'},
|
||||||
{'default:wood','default:steel_ingot','default:wood'},
|
{'group:wood','group:ingot','group:wood'},
|
||||||
{'default:wood','default:wood','default:wood'}
|
{'group:wood','group:wood','group:wood'}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
BIN
textures/cobblechest_front.png
Normal file → Executable file
Before Width: | Height: | Size: 728 B After Width: | Height: | Size: 385 B |
BIN
textures/dropbox_front.png
Normal file → Executable file
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 648 B |
BIN
textures/dropbox_right.png
Normal file → Executable file
Before Width: | Height: | Size: 765 B After Width: | Height: | Size: 567 B |
BIN
textures/secret_front.png
Normal file → Executable file
Before Width: | Height: | Size: 807 B After Width: | Height: | Size: 631 B |
BIN
textures/shared_front.png
Normal file → Executable file
Before Width: | Height: | Size: 818 B After Width: | Height: | Size: 642 B |
BIN
textures/wifi_front_animated.png
Normal file → Executable file
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 234 B |
BIN
textures/wifi_side.png
Normal file → Executable file
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 149 B |
BIN
textures/wifi_top.png
Normal file → Executable file
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 139 B |
8
wifi.lua
Normal file → Executable file
@ -5,15 +5,17 @@ minetest.register_node("more_chests:wifi", {
|
|||||||
{name="wifi_front_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}
|
{name="wifi_front_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}
|
||||||
},
|
},
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,},
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
|
||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec",
|
meta:set_string("formspec",
|
||||||
"size[8,9]"..
|
"size[8,9]"..
|
||||||
"list[current_player;more_chests:wifi;0,0;8,4;]"..
|
"list[current_player;more_chests:wifi;0,0;8,4;]"..
|
||||||
"list[current_player;main;0,5;8,4;]")
|
"list[current_player;main;0,5;8,4;]"..
|
||||||
|
"listring[current_player;more_chests:wifi]" ..
|
||||||
|
"listring[current_player;main]")
|
||||||
meta:set_string("infotext", "Wifi Chest")
|
meta:set_string("infotext", "Wifi Chest")
|
||||||
end,
|
end,
|
||||||
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|