mirror of
https://github.com/minetest-mods/more_chests.git
synced 2025-06-30 14:20:31 +02:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
f2ab35cd02 |
@ -1,6 +1,3 @@
|
||||
-- Load support for translation.
|
||||
local S = minetest.get_translator("more_chests")
|
||||
|
||||
local function has_locked_chest_privilege(meta, player)
|
||||
if player:get_player_name() ~= meta:get_string("owner") then
|
||||
return false
|
||||
@ -9,7 +6,7 @@ local function has_locked_chest_privilege(meta, player)
|
||||
end
|
||||
|
||||
minetest.register_node("more_chests:cobble", {
|
||||
description = S("Cobble Chest"),
|
||||
description = "Cobble Chest",
|
||||
tiles = {"default_cobble.png", "default_cobble.png", "default_cobble.png",
|
||||
"default_cobble.png", "default_cobble.png", "cobblechest_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
@ -113,3 +110,4 @@ minetest.register_craft({
|
||||
{'default:wood','default:cobble','default:wood'}
|
||||
}
|
||||
})
|
||||
|
||||
|
1
depends.txt
Normal file
1
depends.txt
Normal file
@ -0,0 +1 @@
|
||||
default
|
1
description.txt
Normal file
1
description.txt
Normal file
@ -0,0 +1 @@
|
||||
Adds several chests that behave differently, and can be used to donate items, share items, hide chests, make secret chests, and more.
|
14
dropbox.lua
14
dropbox.lua
@ -1,7 +1,3 @@
|
||||
-- Load support for translation.
|
||||
local S = minetest.get_translator("more_chests")
|
||||
local DS = minetest.get_translator("default")
|
||||
|
||||
local function has_locked_chest_privilege(meta, player)
|
||||
if player:get_player_name() ~= meta:get_string("owner") then
|
||||
return false
|
||||
@ -10,7 +6,7 @@ local function has_locked_chest_privilege(meta, player)
|
||||
end
|
||||
|
||||
minetest.register_node("more_chests:dropbox", {
|
||||
description = S("Dropbox"),
|
||||
description = "Dropbox",
|
||||
tiles = {"dropbox_top.png", "dropbox_top.png", "dropbox_side.png",
|
||||
"dropbox_side.png", "dropbox_side.png", "dropbox_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
@ -35,9 +31,8 @@ minetest.register_node("more_chests:dropbox", {
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", S("@1 (owned by @2)",
|
||||
S("Dropbox"),
|
||||
meta:get_string("owner")))
|
||||
meta:set_string("infotext", "Dropbox (owned by "..
|
||||
meta:get_string("owner")..")")
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
@ -52,7 +47,7 @@ minetest.register_node("more_chests:dropbox", {
|
||||
"listring[current_name;main]" ..
|
||||
"listring[current_player;main]" ..
|
||||
default.get_hotbar_bg(0,4.85))
|
||||
meta:set_string("infotext", DS("Chest"))
|
||||
meta:set_string("infotext", "Chest")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
end,
|
||||
@ -111,3 +106,4 @@ minetest.register_craft({
|
||||
{'default:wood','default:wood','default:wood'}
|
||||
}
|
||||
})
|
||||
|
||||
|
1
init.lua
1
init.lua
@ -5,3 +5,4 @@ dofile(minetest.get_modpath("more_chests").."/shared.lua")
|
||||
dofile(minetest.get_modpath("more_chests").."/wifi.lua")
|
||||
dofile(minetest.get_modpath("more_chests").."/aliases.lua")
|
||||
|
||||
minetest.log("action", "[more_chests] loaded.")
|
||||
|
@ -1,11 +0,0 @@
|
||||
# textdomain: more_chests
|
||||
Cobble Chest=Coffre en pierre taillée
|
||||
Dropbox=Boîte de dépôt
|
||||
Secret Chest=Coffre secret
|
||||
Shared Chest=Coffre partagé
|
||||
Wifi Chest=Coffre wifi
|
||||
|
||||
|
||||
@1 (owned by @2)=@1 (appartient à @2)
|
||||
Shared with (separate names with spaces)=Partagé avec (séparez les noms avec des espaces)
|
||||
submit=valider
|
@ -1,12 +0,0 @@
|
||||
# textdomain: more_chests
|
||||
|
||||
# Translation by An0n3m0us
|
||||
|
||||
Secret Chest=Titkos Láda
|
||||
Wifi Chest=Wifi Láda
|
||||
Cobble Chest=Zúzottkő Láda
|
||||
Shared Chest=Közös Láda
|
||||
|
||||
@1 (owned by @2)=@1 (@2 tulajdonában van)
|
||||
Shared with (separate names with spaces)=Megosztva (válassza el a neveket szóközökkel)
|
||||
submit=előterjeszt
|
@ -1,6 +0,0 @@
|
||||
# textdomain: more_chests
|
||||
Secret Chest=
|
||||
Wifi Chest=
|
||||
Cobble Chest=
|
||||
Shared Chest=
|
||||
Dropbox=
|
2
mod.conf
2
mod.conf
@ -1,3 +1 @@
|
||||
name = more_chests
|
||||
description = Adds several chests that behave differently, and can be used to donate items, share items, hide chests, make secret chests, and more.
|
||||
depends = default
|
||||
|
13
secret.lua
13
secret.lua
@ -1,6 +1,3 @@
|
||||
-- Load support for translation.
|
||||
local S = minetest.get_translator("more_chests")
|
||||
|
||||
local function has_locked_chest_privilege(meta, player)
|
||||
if player:get_player_name() ~= meta:get_string("owner") then
|
||||
return false
|
||||
@ -23,7 +20,7 @@ local closed = "size[2,1]"..
|
||||
"button[0,0;2,1;open;open]"
|
||||
|
||||
minetest.register_node("more_chests:secret", {
|
||||
description = S("Secret Chest"),
|
||||
description = "Secret Chest",
|
||||
tiles = {"secret_top.png", "secret_top.png", "secret_side.png",
|
||||
"secret_side.png", "secret_side.png", "secret_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
@ -48,14 +45,13 @@ minetest.register_node("more_chests:secret", {
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", S("@1 (owned by @2)",
|
||||
S("Secret Chest"),
|
||||
meta:get_string("owner")))
|
||||
meta:set_string("infotext", "Secret Chest (owned by "..
|
||||
meta:get_string("owner")..")")
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", open)
|
||||
meta:set_string("infotext", S("Secret Chest"))
|
||||
meta:set_string("infotext", "Secret Chest")
|
||||
meta:set_string("owner", "")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
@ -130,3 +126,4 @@ minetest.register_craft({
|
||||
{'default:wood','default:wood','default:wood'}
|
||||
}
|
||||
})
|
||||
|
||||
|
17
shared.lua
17
shared.lua
@ -1,6 +1,3 @@
|
||||
-- Load support for translation.
|
||||
local S = minetest.get_translator("more_chests")
|
||||
|
||||
local function has_locked_chest_privilege(meta, player)
|
||||
local name = player:get_player_name()
|
||||
local shared = " "..meta:get_string("shared").." "
|
||||
@ -22,15 +19,15 @@ local function get_formspec(string)
|
||||
"list[current_name;main;0,0.3;8,4;]"..
|
||||
"list[current_player;main;0,4.85;8,1;]" ..
|
||||
"list[current_player;main;0,6;8,3;8]" ..
|
||||
"field[.25,9.5;8,1;shared;"..S("Shared with (separate names with spaces)")..":;"..string.."]"..
|
||||
"button[6,9.2;2,1;submit;"..S("submit").."]" ..
|
||||
"field[.25,9.5;6,1;shared;Shared with (separate names with spaces):;"..string.."]"..
|
||||
"button[6,9.2;2,1;submit;submit]" ..
|
||||
"listring[current_name;main]" ..
|
||||
"listring[current_player;main]" ..
|
||||
default.get_hotbar_bg(0,4.85)
|
||||
end
|
||||
|
||||
minetest.register_node("more_chests:shared", {
|
||||
description = S("Shared Chest"),
|
||||
description = "Shared Chest",
|
||||
tiles = {"shared_top.png", "shared_top.png", "shared_side.png",
|
||||
"shared_side.png", "shared_side.png", "shared_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
@ -55,14 +52,13 @@ minetest.register_node("more_chests:shared", {
|
||||
after_place_node = function(pos, placer)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", S("@1 (owned by @2)",
|
||||
S("Shared Chest"),
|
||||
meta:get_string("owner")))
|
||||
meta:set_string("infotext", "Shared Chest (owned by "..
|
||||
meta:get_string("owner")..")")
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", get_formspec(""))
|
||||
meta:set_string("infotext", S("Shared Chest"))
|
||||
meta:set_string("infotext", "Shared Chest")
|
||||
meta:set_string("owner", "")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
@ -136,3 +132,4 @@ minetest.register_craft({
|
||||
{'default:wood','default:wood','default:wood'}
|
||||
}
|
||||
})
|
||||
|
||||
|
BIN
textures/wifi_front.png
Normal file
BIN
textures/wifi_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 864 B |
Binary file not shown.
Before Width: | Height: | Size: 462 B |
Binary file not shown.
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 833 B |
Binary file not shown.
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 741 B |
12
wifi.lua
12
wifi.lua
@ -1,12 +1,7 @@
|
||||
-- Load support for translation.
|
||||
local S = minetest.get_translator("more_chests")
|
||||
|
||||
minetest.register_node("more_chests:wifi", {
|
||||
description = S("Wifi Chest"),
|
||||
description = "Wifi Chest",
|
||||
tiles = {"wifi_top.png", "wifi_top.png", "wifi_side.png",
|
||||
"wifi_side.png", "wifi_side.png",
|
||||
{name="wifi_front_animated.png", animation={type="vertical_frames",
|
||||
aspect_w=16, aspect_h=16, length=2.0}}},
|
||||
"wifi_side.png", "wifi_side.png", "wifi_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,},
|
||||
legacy_facedir_simple = true,
|
||||
@ -25,7 +20,7 @@ minetest.register_node("more_chests:wifi", {
|
||||
"listring[current_player;main]" ..
|
||||
default.get_hotbar_bg(0,4.85))
|
||||
|
||||
meta:set_string("infotext", S("Wifi Chest"))
|
||||
meta:set_string("infotext", "Wifi Chest")
|
||||
end,
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
minetest.log("action", player:get_player_name()..
|
||||
@ -54,3 +49,4 @@ minetest.register_on_joinplayer(function(player)
|
||||
local inv = player:get_inventory()
|
||||
inv:set_size("more_chests:wifi", 8*4)
|
||||
end)
|
||||
|
||||
|
Reference in New Issue
Block a user