168 lines
6.1 KiB
Lua
168 lines
6.1 KiB
Lua
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,
|
|
})
|