testing git stuff
|
@ -0,0 +1,81 @@
|
|||
beds.register_bed("wood_plus:acacia_bed", {
|
||||
description = "Simple Acacia Bed",
|
||||
inventory_image = "wood_plus_acacia_bed.png",
|
||||
wield_image = "wood_plus_acacia_bed.png",
|
||||
tiles = {
|
||||
bottom = {
|
||||
"beds_bed_top_bottom.png^[transformR90",
|
||||
"default_acacia_wood.png",
|
||||
"wood_plus_acacia_bed_side_bottom_r.png",
|
||||
"wood_plus_acacia_bed_side_bottom_r.png^[transformfx",
|
||||
"beds_transparent.png",
|
||||
"wood_plus_acacia_bed_side_bottom.png"
|
||||
},
|
||||
top = {
|
||||
"beds_bed_top_top.png^[transformR90",
|
||||
"default_acacia_wood.png",
|
||||
"wood_plus_acacia_bed_side_top_r.png",
|
||||
"wood_plus_acacia_bed_side_top_r.png^[transformfx",
|
||||
"wood_plus_acacia_bed_side_top.png",
|
||||
"beds_transparent.png",
|
||||
}
|
||||
},
|
||||
nodebox = {
|
||||
bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
||||
top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
|
||||
},
|
||||
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
||||
recipe = {
|
||||
{"wool:red", "wool:red", "wool:white"},
|
||||
{"default:acacia_wood", "default:acacia_wood", "default:acacia_wood"}
|
||||
},
|
||||
})
|
||||
|
||||
beds.register_bed("wood_plus:fancy_acacia_bed", {
|
||||
description = "Fancy Acacia Bed",
|
||||
inventory_image = "wood_plus_fancy_acacia_bed.png",
|
||||
wield_image = "wood_plus_fancy_acacia_bed.png",
|
||||
tiles = {
|
||||
bottom = {
|
||||
"wood_plus_acacia_bed_top1.png",
|
||||
"default_acacia_wood.png",
|
||||
"wood_plus_acacia_bed_side1.png",
|
||||
"wood_plus_acacia_bed_side1.png^[transformFX",
|
||||
"default_acacia_wood.png",
|
||||
"wood_plus_acacia_bed_foot.png",
|
||||
},
|
||||
top = {
|
||||
"wood_plus_acacia_bed_top2.png",
|
||||
"default_acacia_wood.png",
|
||||
"wood_plus_acacia_bed_side2.png",
|
||||
"wood_plus_acacia_bed_side2.png^[transformFX",
|
||||
"wood_plus_acacia_bed_head.png",
|
||||
"default_acacia_wood.png",
|
||||
}
|
||||
},
|
||||
nodebox = {
|
||||
bottom = {
|
||||
{-0.5, -0.5, -0.5, -0.375, -0.065, -0.4375},
|
||||
{0.375, -0.5, -0.5, 0.5, -0.065, -0.4375},
|
||||
{-0.5, -0.375, -0.5, 0.5, -0.125, -0.4375},
|
||||
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
|
||||
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
|
||||
{-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5},
|
||||
},
|
||||
top = {
|
||||
{-0.5, -0.5, 0.4375, -0.375, 0.1875, 0.5},
|
||||
{0.375, -0.5, 0.4375, 0.5, 0.1875, 0.5},
|
||||
{-0.5, 0, 0.4375, 0.5, 0.125, 0.5},
|
||||
{-0.5, -0.375, 0.4375, 0.5, -0.125, 0.5},
|
||||
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
|
||||
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
|
||||
{-0.4375, -0.3125, -0.5, 0.4375, -0.0625, 0.4375},
|
||||
}
|
||||
},
|
||||
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
|
||||
recipe = {
|
||||
{"", "", "group:stick"},
|
||||
{"wool:red", "wool:red", "wool:white"},
|
||||
{"default:acacia_wood", "default:acacia_wood", "default:acacia_wood"},
|
||||
},
|
||||
})
|
|
@ -0,0 +1,513 @@
|
|||
local chest_formspec =
|
||||
"size[8,9]" ..
|
||||
default.gui_bg ..
|
||||
default.gui_bg_img ..
|
||||
default.gui_slots ..
|
||||
"list[current_name;main;0,0.3;8,4;]" ..
|
||||
"list[current_player;main;0,4.85;8,1;]" ..
|
||||
"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)
|
||||
|
||||
local function get_locked_chest_formspec(pos)
|
||||
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
|
||||
local formspec =
|
||||
"size[8,9]" ..
|
||||
default.gui_bg ..
|
||||
default.gui_bg_img ..
|
||||
default.gui_slots ..
|
||||
"list[nodemeta:" .. spos .. ";main;0,0.3;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)
|
||||
return formspec
|
||||
end
|
||||
|
||||
local function has_locked_chest_privilege(meta, player)
|
||||
local name = ""
|
||||
if player then
|
||||
if minetest.check_player_privs(player, "protection_bypass") then
|
||||
return true
|
||||
end
|
||||
name = player:get_player_name()
|
||||
end
|
||||
if name ~= meta:get_string("owner") then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
minetest.register_node("wood_plus:acacia_chest", {
|
||||
description = "Acacia Chest",
|
||||
tiles = {"wood_plus_acacia_chest_top.png", "wood_plus_acacia_chest_top.png", "wood_plus_acacia_chest_side.png",
|
||||
"wood_plus_acacia_chest_side.png", "wood_plus_acacia_chest_side.png", "wood_plus_acacia_chest_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2},
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", chest_formspec)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main")
|
||||
end,
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index,
|
||||
to_list, to_index, count, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves stuff in chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_blast = function(pos)
|
||||
local drops = {}
|
||||
default.get_inventory_drops(pos, "main", drops)
|
||||
drops[#drops+1] = "wood_plus:acacia_chest"
|
||||
minetest.remove_node(pos)
|
||||
return drops
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:acacia_chest_locked", {
|
||||
description = "Locked Acacia Chest",
|
||||
tiles = {"wood_plus_acacia_chest_top.png", "wood_plus_acacia_chest_top.png", "wood_plus_acacia_chest_side.png",
|
||||
"wood_plus_acacia_chest_side.png", "wood_plus_acacia_chest_side.png", "wood_plus_acacia_lock_chest_front.png"},
|
||||
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)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "Locked Chest (owned by " ..
|
||||
meta:get_string("owner") .. ")")
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", "")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8 * 4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
|
||||
end,
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index,
|
||||
to_list, to_index, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return count
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to locked chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from locked chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if has_locked_chest_privilege(meta, clicker) then
|
||||
minetest.show_formspec(
|
||||
clicker:get_player_name(),
|
||||
"wood_plus:acacia_chest_locked",
|
||||
get_locked_chest_formspec(pos)
|
||||
)
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_blast = function() end,
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:aspen_chest", {
|
||||
description = "Aspen Chest",
|
||||
tiles = {"wood_plus_aspen_chest_top.png", "wood_plus_aspen_chest_top.png", "wood_plus_aspen_chest_side.png",
|
||||
"wood_plus_aspen_chest_side.png", "wood_plus_aspen_chest_side.png", "wood_plus_aspen_chest_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2},
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", chest_formspec)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main")
|
||||
end,
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index,
|
||||
to_list, to_index, count, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves stuff in chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_blast = function(pos)
|
||||
local drops = {}
|
||||
default.get_inventory_drops(pos, "main", drops)
|
||||
drops[#drops+1] = "wood_plus:aspen_chest"
|
||||
minetest.remove_node(pos)
|
||||
return drops
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:aspen_chest_locked", {
|
||||
description = "Locked Aspen Chest",
|
||||
tiles = {"wood_plus_aspen_chest_top.png", "wood_plus_aspen_chest_top.png", "wood_plus_aspen_chest_side.png",
|
||||
"wood_plus_aspen_chest_side.png", "wood_plus_aspen_chest_side.png", "wood_plus_aspen_lock_chest_front.png"},
|
||||
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)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "Locked Chest (owned by " ..
|
||||
meta:get_string("owner") .. ")")
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", "")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8 * 4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
|
||||
end,
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index,
|
||||
to_list, to_index, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return count
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to locked chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from locked chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if has_locked_chest_privilege(meta, clicker) then
|
||||
minetest.show_formspec(
|
||||
clicker:get_player_name(),
|
||||
"wood_plus:aspen_chest_locked",
|
||||
get_locked_chest_formspec(pos)
|
||||
)
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_blast = function() end,
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:jungle_chest", {
|
||||
description = "Jungle Chest",
|
||||
tiles = {"wood_plus_jungle_chest_top.png", "wood_plus_jungle_chest_top.png", "wood_plus_jungle_chest_side.png",
|
||||
"wood_plus_jungle_chest_side.png", "wood_plus_jungle_chest_side.png", "wood_plus_jungle_chest_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2},
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", chest_formspec)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main")
|
||||
end,
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index,
|
||||
to_list, to_index, count, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves stuff in chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_blast = function(pos)
|
||||
local drops = {}
|
||||
default.get_inventory_drops(pos, "main", drops)
|
||||
drops[#drops+1] = "wood_plus:jungle_chest"
|
||||
minetest.remove_node(pos)
|
||||
return drops
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:jungle_chest_locked", {
|
||||
description = "Locked Jungle Chest",
|
||||
tiles = {"wood_plus_jungle_chest_top.png", "wood_plus_jungle_chest_top.png", "wood_plus_jungle_chest_side.png",
|
||||
"wood_plus_jungle_chest_side.png", "wood_plus_jungle_chest_side.png", "wood_plus_jungle_lock_chest_front.png"},
|
||||
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)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "Locked Chest (owned by " ..
|
||||
meta:get_string("owner") .. ")")
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", "")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8 * 4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
|
||||
end,
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index,
|
||||
to_list, to_index, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return count
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to locked chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from locked chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if has_locked_chest_privilege(meta, clicker) then
|
||||
minetest.show_formspec(
|
||||
clicker:get_player_name(),
|
||||
"wood_plus:jungle_chest_locked",
|
||||
get_locked_chest_formspec(pos)
|
||||
)
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_blast = function() end,
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:pine_chest", {
|
||||
description = "Pine Chest",
|
||||
tiles = {"wood_plus_pine_chest_top.png", "wood_plus_pine_chest_top.png", "wood_plus_pine_chest_side.png",
|
||||
"wood_plus_pine_chest_side.png", "wood_plus_pine_chest_side.png", "wood_plus_pine_chest_front.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2},
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", chest_formspec)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8*4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main")
|
||||
end,
|
||||
on_metadata_inventory_move = function(pos, from_list, from_index,
|
||||
to_list, to_index, count, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves stuff in chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_blast = function(pos)
|
||||
local drops = {}
|
||||
default.get_inventory_drops(pos, "main", drops)
|
||||
drops[#drops+1] = "wood_plus:pine_chest"
|
||||
minetest.remove_node(pos)
|
||||
return drops
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:pine_chest_locked", {
|
||||
description = "Locked Pine Chest",
|
||||
tiles = {"wood_plus_pine_chest_top.png", "wood_plus_pine_chest_top.png", "wood_plus_pine_chest_side.png",
|
||||
"wood_plus_pine_chest_side.png", "wood_plus_pine_chest_side.png", "wood_plus_pine_lock_chest_front.png"},
|
||||
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)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", placer:get_player_name() or "")
|
||||
meta:set_string("infotext", "Locked Chest (owned by " ..
|
||||
meta:get_string("owner") .. ")")
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("owner", "")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 8 * 4)
|
||||
end,
|
||||
can_dig = function(pos,player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
|
||||
end,
|
||||
allow_metadata_inventory_move = function(pos, from_list, from_index,
|
||||
to_list, to_index, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return count
|
||||
end,
|
||||
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not has_locked_chest_privilege(meta, player) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" moves " .. stack:get_name() ..
|
||||
" to locked chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_metadata_inventory_take = function(pos, listname, index, stack, player)
|
||||
minetest.log("action", player:get_player_name() ..
|
||||
" takes " .. stack:get_name() ..
|
||||
" from locked chest at " .. minetest.pos_to_string(pos))
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if has_locked_chest_privilege(meta, clicker) then
|
||||
minetest.show_formspec(
|
||||
clicker:get_player_name(),
|
||||
"wood_plus:pine_chest_locked",
|
||||
get_locked_chest_formspec(pos)
|
||||
)
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_blast = function() end,
|
||||
})
|
|
@ -0,0 +1,99 @@
|
|||
-- Extra chests
|
||||
|
||||
minetest.register_craft({
|
||||
output = "wood_plus:acacia_chest",
|
||||
recipe = {
|
||||
{"default:acacia_wood", "default:acacia_wood", "default:acacia_wood"},
|
||||
{"default:acacia_wood", "" , "default:acacia_wood"},
|
||||
{"default:acacia_wood", "default:acacia_wood", "default:acacia_wood"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "wood_plus:aspen_chest",
|
||||
recipe = {
|
||||
{"default:_aspen_wood", "default:_aspen_wood", "default:_aspen_wood"},
|
||||
{"default:_aspen_wood", "" , "default:_aspen_wood"},
|
||||
{"default:_aspen_wood", "default:_aspen_wood", "default:_aspen_wood"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "wood_plus:pine_chest",
|
||||
recipe = {
|
||||
{"default:pine_wood", "default:pine_wood", "default:pine_wood"},
|
||||
{"default:pine_wood", "" , "default:pine_wood"},
|
||||
{"default:pine_wood", "default:pine_wood", "default:pine_wood"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "wood_plus:jungle_chest",
|
||||
recipe = {
|
||||
{"default:junglewood", "default:junglewood", "default:junglewood"},
|
||||
{"default:junglewood", "" , "default:junglewood",},
|
||||
{"default:junglewood", "default:junglewood", "default:junglewood"}
|
||||
}
|
||||
})
|
||||
|
||||
-- Extra ladders
|
||||
|
||||
minetest.register_craft({
|
||||
output = "wood_plus:acacia_ladder",
|
||||
recipe = {
|
||||
{"wood_plus:acacia_stick", "wood_plus:acacia_stick", "wood_plus:acacia_stick"},
|
||||
{"wood_plus:acacia_stick", "" , "wood_plus:acacia_stick"},
|
||||
{"wood_plus:acacia_stick", "wood_plus:acacia_stick", "wood_plus:acacia_stick"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "wood_plus:aspen_ladder",
|
||||
recipe = {
|
||||
{"wood_plus:aspen_stick", "wood_plus:aspen_stick", "wood_plus:aspen_stick"},
|
||||
{"wood_plus:aspen_stick", "" , "wood_plus:aspen_stick"},
|
||||
{"wood_plus:aspen_stick", "wood_plus:aspen_stick", "wood_plus:aspen_stick"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "wood_plus:pine_ladder",
|
||||
recipe = {
|
||||
{"wood_plus:pine_stick", "wood_plus:pine_stick", "wood_plus:pine_stick"},
|
||||
{"wood_plus:pine_stick", "" , "wood_plus:pine_stick"},
|
||||
{"wood_plus:pine_stick", "wood_plus:pine_stick", "wood_plus:pine_stick"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "wood_plus:jungle_ladder",
|
||||
recipe = {
|
||||
{"wood_plus:jungle_stick", "wood_plus:jungle_stick", "wood_plus:jungle_stick"},
|
||||
{"wood_plus:jungle_stick", "" , "wood_plus:jungle_stick"},
|
||||
{"wood_plus:jungle_stick", "wood_plus:jungle_stick", "wood_plus:jungle_stick"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("wood_plus:acacia_stick", {
|
||||
description = "Acacia Stick",
|
||||
inventory_image = "wood_plus_acacia_stick.png",
|
||||
groups = {stick = 1, flammable = 2},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("wood_plus:aspen_stick", {
|
||||
description = "Aspen Stick",
|
||||
inventory_image = "wood_plus_aspen_stick.png",
|
||||
groups = {stick = 1, flammable = 2},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("wood_plus:pine_stick", {
|
||||
description = "Pine Stick",
|
||||
inventory_image = "wood_plus_pine_stick.png",
|
||||
groups = {stick = 1, flammable = 2},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("wood_plus:jungle_stick", {
|
||||
description = "Jungle Stick",
|
||||
inventory_image = "wood_plus_jungle_stick.png",
|
||||
groups = {stick = 1, flammable = 2},
|
||||
})
|
|
@ -0,0 +1,3 @@
|
|||
default
|
||||
doors
|
||||
beds
|
|
@ -0,0 +1,51 @@
|
|||
doors.register("wood_plus:acacia_door", {
|
||||
tiles = {{name = "wood_plus_acacia_door.png", backface_culling = true}},
|
||||
description = "Acacia Door",
|
||||
inventory_image = "wood_plus_item_acacia_door.png",
|
||||
protected = true,
|
||||
groups = {cracky = 1, level = 2},
|
||||
recipe = {
|
||||
{"default:acacia_wood", "default:acacia_wood"},
|
||||
{"default:acacia_wood", "default:acacia_wood"},
|
||||
{"default:acacia_wood", "default:acacia_wood"},
|
||||
}
|
||||
})
|
||||
|
||||
doors.register("wood_plus:pine_door", {
|
||||
tiles = {{name = "wood_plus_pine_door.png", backface_culling = true}},
|
||||
description = "Pine Door",
|
||||
inventory_image = "wood_plus_item_pine_door.png",
|
||||
protected = true,
|
||||
groups = {cracky = 1, level = 2},
|
||||
recipe = {
|
||||
{"default:pine_wood", "default:pine_wood"},
|
||||
{"default:pine_wood", "default:pine_wood"},
|
||||
{"default:pine_wood", "default:pine_wood"},
|
||||
}
|
||||
})
|
||||
|
||||
doors.register("wood_plus:jungle_door", {
|
||||
tiles = {{name = "wood_plus_jungle_door.png", backface_culling = true}},
|
||||
description = "Jungle Door",
|
||||
inventory_image = "wood_plus_item_jungle_door.png",
|
||||
protected = true,
|
||||
groups = {cracky = 1, level = 2},
|
||||
recipe = {
|
||||
{"default:junglewood", "default:junglewood"},
|
||||
{"default:junglewood", "default:junglewood"},
|
||||
{"default:junglewood", "default:junglewood"},
|
||||
}
|
||||
})
|
||||
|
||||
doors.register("wood_plus:aspen_door", {
|
||||
tiles = {{name = "wood_plus_aspen_door.png", backface_culling = true}},
|
||||
description = "Aspen Door",
|
||||
inventory_image = "wood_plus_item_aspen_door.png",
|
||||
protected = true,
|
||||
groups = {cracky = 1, level = 2},
|
||||
recipe = {
|
||||
{"default:aspen_wood", "default:aspen_wood"},
|
||||
{"default:aspen_wood", "default:aspen_wood"},
|
||||
{"default:aspen_wood", "default:aspen_wood"},
|
||||
}
|
||||
})
|
|
@ -0,0 +1,8 @@
|
|||
dofile(minetest.get_modpath("wood_plus") .. "/ladders.lua")
|
||||
dofile(minetest.get_modpath("wood_plus") .. "/chests.lua")
|
||||
dofile(minetest.get_modpath("wood_plus") .. "/trapdoors.lua")
|
||||
dofile(minetest.get_modpath("wood_plus") .. "/doors.lua")
|
||||
dofile(minetest.get_modpath("wood_plus") .. "/signs.lua")
|
||||
dofile(minetest.get_modpath("wood_plus") .. "/beds.lua")
|
||||
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
minetest.register_node("wood_plus:aspen_ladder", {
|
||||
description = "Aspen Ladder",
|
||||
drawtype = "signlike",
|
||||
tiles = {"wood_plus_aspen_ladder.png"},
|
||||
inventory_image = "wood_plus_aspen_ladder.png",
|
||||
wield_image = "wood_plus_aspen_ladder.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:pine_ladder", {
|
||||
description = "Pine Ladder",
|
||||
drawtype = "signlike",
|
||||
tiles = {"wood_plus_pine_ladder.png"},
|
||||
inventory_image = "wood_plus_pine_ladder.png",
|
||||
wield_image = "wood_plus_pine_ladder.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:acacia_ladder", {
|
||||
description = "Acacia Ladder",
|
||||
drawtype = "signlike",
|
||||
tiles = {"wood_plus_acacia_ladder.png"},
|
||||
inventory_image = "wood_plus_acacia_ladder.png",
|
||||
wield_image = "wood_plus_acacia_ladder.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:jungle_ladder", {
|
||||
description = "Jungle Ladder",
|
||||
drawtype = "signlike",
|
||||
tiles = {"wood_plus_jungle_ladder.png"},
|
||||
inventory_image = "wood_plus_jungle_ladder.png",
|
||||
wield_image = "wood_plus_jungle_ladder.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "wallmounted",
|
||||
},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
|
@ -0,0 +1,167 @@
|
|||
minetest.register_node("wood_plus:acacia_sign_wall", {
|
||||
description ="Acacia Sign",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"wood_plus_acacia_sign_wall.png"},
|
||||
inventory_image = "wood_plus_acacia_sign.png",
|
||||
wield_image = "wood_plus_acacia_sign.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
node_box = {
|
||||
type = "wallmounted",
|
||||
wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
|
||||
wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
|
||||
wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
|
||||
},
|
||||
groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
--local n = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", "field[text;;${text}]")
|
||||
end,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
--print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
|
||||
local player_name = sender:get_player_name()
|
||||
if minetest.is_protected(pos, player_name) then
|
||||
minetest.record_protection_violation(pos, player_name)
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not fields.text then return end
|
||||
minetest.log("action", (player_name or "") .. " wrote \"" ..
|
||||
fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
|
||||
meta:set_string("text", fields.text)
|
||||
meta:set_string("infotext", '"' .. fields.text .. '"')
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:pine_sign_wall", {
|
||||
description ="Pine Sign",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"wood_plus_pine_sign_wall.png"},
|
||||
inventory_image = "wood_plus_pine_sign.png",
|
||||
wield_image = "wood_plus_pine_sign.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
node_box = {
|
||||
type = "wallmounted",
|
||||
wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
|
||||
wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
|
||||
wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
|
||||
},
|
||||
groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
--local n = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", "field[text;;${text}]")
|
||||
end,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
--print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
|
||||
local player_name = sender:get_player_name()
|
||||
if minetest.is_protected(pos, player_name) then
|
||||
minetest.record_protection_violation(pos, player_name)
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not fields.text then return end
|
||||
minetest.log("action", (player_name or "") .. " wrote \"" ..
|
||||
fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
|
||||
meta:set_string("text", fields.text)
|
||||
meta:set_string("infotext", '"' .. fields.text .. '"')
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:aspen_sign_wall", {
|
||||
description =" Aspen Sign",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"wood_plus_aspen_sign_wall.png"},
|
||||
inventory_image = "wood_plus_aspen_sign.png",
|
||||
wield_image = "wood_plus_aspen_sign.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
node_box = {
|
||||
type = "wallmounted",
|
||||
wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
|
||||
wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
|
||||
wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
|
||||
},
|
||||
groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
--local n = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", "field[text;;${text}]")
|
||||
end,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
--print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
|
||||
local player_name = sender:get_player_name()
|
||||
if minetest.is_protected(pos, player_name) then
|
||||
minetest.record_protection_violation(pos, player_name)
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not fields.text then return end
|
||||
minetest.log("action", (player_name or "") .. " wrote \"" ..
|
||||
fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
|
||||
meta:set_string("text", fields.text)
|
||||
meta:set_string("infotext", '"' .. fields.text .. '"')
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("wood_plus:jungle_sign_wall", {
|
||||
description =" Jungle Sign",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"wood_plus_jungle_sign_wall.png"},
|
||||
inventory_image = "wood_plus_jungle_sign.png",
|
||||
wield_image = "wood_plus_jungle_sign.png",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
walkable = false,
|
||||
node_box = {
|
||||
type = "wallmounted",
|
||||
wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
|
||||
wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
|
||||
wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
|
||||
},
|
||||
groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3},
|
||||
legacy_wallmounted = true,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_construct = function(pos)
|
||||
--local n = minetest.get_node(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", "field[text;;${text}]")
|
||||
end,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
--print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
|
||||
local player_name = sender:get_player_name()
|
||||
if minetest.is_protected(pos, player_name) then
|
||||
minetest.record_protection_violation(pos, player_name)
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not fields.text then return end
|
||||
minetest.log("action", (player_name or "") .. " wrote \"" ..
|
||||
fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
|
||||
meta:set_string("text", fields.text)
|
||||
meta:set_string("infotext", '"' .. fields.text .. '"')
|
||||
end,
|
||||
})
|
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 556 B |
After Width: | Height: | Size: 143 B |
After Width: | Height: | Size: 506 B |
After Width: | Height: | Size: 370 B |
After Width: | Height: | Size: 346 B |
After Width: | Height: | Size: 287 B |
After Width: | Height: | Size: 288 B |
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 424 B |
After Width: | Height: | Size: 414 B |
After Width: | Height: | Size: 567 B |
After Width: | Height: | Size: 636 B |
After Width: | Height: | Size: 446 B |
After Width: | Height: | Size: 404 B |
After Width: | Height: | Size: 406 B |
After Width: | Height: | Size: 1007 B |
After Width: | Height: | Size: 433 B |
After Width: | Height: | Size: 502 B |
After Width: | Height: | Size: 401 B |
After Width: | Height: | Size: 466 B |
After Width: | Height: | Size: 152 B |
After Width: | Height: | Size: 330 B |
After Width: | Height: | Size: 181 B |
After Width: | Height: | Size: 571 B |
After Width: | Height: | Size: 551 B |
After Width: | Height: | Size: 590 B |
After Width: | Height: | Size: 992 B |
After Width: | Height: | Size: 411 B |
After Width: | Height: | Size: 608 B |
After Width: | Height: | Size: 345 B |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 190 B |
After Width: | Height: | Size: 323 B |
After Width: | Height: | Size: 173 B |
After Width: | Height: | Size: 525 B |
After Width: | Height: | Size: 202 B |
After Width: | Height: | Size: 184 B |
After Width: | Height: | Size: 180 B |
After Width: | Height: | Size: 187 B |
After Width: | Height: | Size: 572 B |
After Width: | Height: | Size: 524 B |
After Width: | Height: | Size: 538 B |
After Width: | Height: | Size: 630 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 619 B |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 408 B |
After Width: | Height: | Size: 122 B |
After Width: | Height: | Size: 332 B |
After Width: | Height: | Size: 205 B |
After Width: | Height: | Size: 584 B |
After Width: | Height: | Size: 475 B |
After Width: | Height: | Size: 519 B |
After Width: | Height: | Size: 879 B |
After Width: | Height: | Size: 399 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 444 B |
After Width: | Height: | Size: 504 B |
After Width: | Height: | Size: 158 B |
After Width: | Height: | Size: 335 B |
After Width: | Height: | Size: 211 B |
|
@ -0,0 +1,35 @@
|
|||
doors.register_trapdoor("wood_plus:acacia_trapdoor", {
|
||||
description = "Acacia Trapdoor",
|
||||
inventory_image = "wood_plus_acacia_trapdoor.png",
|
||||
wield_image = "wood_plus_acacia_trapdoor.png",
|
||||
tile_front = "wood_plus_acacia_trapdoor.png",
|
||||
tile_side = "wood_plus_acacia_trapdoor_side.png",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door = 1},
|
||||
})
|
||||
|
||||
doors.register_trapdoor("wood_plus:aspen_trapdoor", {
|
||||
description = "Aspen Trapdoor",
|
||||
inventory_image = "wood_plus_aspen_trapdoor.png",
|
||||
wield_image = "wood_plus_aspen_trapdoor.png",
|
||||
tile_front = "wood_plus_aspen_trapdoor.png",
|
||||
tile_side = "wood_plus_aspen_trapdoor_side.png",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door = 1},
|
||||
})
|
||||
|
||||
doors.register_trapdoor("wood_plus:jungle_trapdoor", {
|
||||
description = "Jungle Trapdoor",
|
||||
inventory_image = "wood_plus_jungle_trapdoor.png",
|
||||
wield_image = "wood_plus_jungle_trapdoor.png",
|
||||
tile_front = "wood_plus_jungle_trapdoor.png",
|
||||
tile_side = "wood_plus_jungle_trapdoor_side.png",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door = 1},
|
||||
})
|
||||
|
||||
doors.register_trapdoor("wood_plus:pine_trapdoor", {
|
||||
description = "Pine Trapdoor",
|
||||
inventory_image = "wood_plus_pine_trapdoor.png",
|
||||
wield_image = "wood_plus_pine_trapdoor.png",
|
||||
tile_front = "wood_plus_pine_trapdoor.png",
|
||||
tile_side = "wood_plus_pine_trapdoor_side.png",
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door = 1},
|
||||
})
|