Default: minor update
This commit is contained in:
parent
9916136063
commit
6a9e92bcd8
@ -1,4 +1,5 @@
|
|||||||
local S = default.S
|
local S = default.S
|
||||||
|
local VER = "2"
|
||||||
|
|
||||||
local neighbor = {
|
local neighbor = {
|
||||||
[0] = {{x = 1, z = 0}, {x = -1, z = 0}},
|
[0] = {{x = 1, z = 0}, {x = -1, z = 0}},
|
||||||
@ -76,7 +77,7 @@ local function on_construct(pos)
|
|||||||
local pos2 = {x = pos.x + nparam2[2].x, y = pos.y, z = pos.z + nparam2[2].z}
|
local pos2 = {x = pos.x + nparam2[2].x, y = pos.y, z = pos.z + nparam2[2].z}
|
||||||
|
|
||||||
if minetest.get_node(pos1).name == "default:chest" then
|
if minetest.get_node(pos1).name == "default:chest" then
|
||||||
minetest.set_node(pos, {name="default:chest_left", param2 = param2})
|
minetest.set_node(pos, {name = "default:chest_left", param2 = param2})
|
||||||
minetest.swap_node(pos1, {name = "default:chest_right", param2 = param2})
|
minetest.swap_node(pos1, {name = "default:chest_right", param2 = param2})
|
||||||
set_large_chest(pos, pos1)
|
set_large_chest(pos, pos1)
|
||||||
elseif minetest.get_node(pos2).name == "default:chest" then
|
elseif minetest.get_node(pos2).name == "default:chest" then
|
||||||
@ -86,7 +87,7 @@ local function on_construct(pos)
|
|||||||
else
|
else
|
||||||
meta:set_string("formspec", chest_formspec)
|
meta:set_string("formspec", chest_formspec)
|
||||||
meta:set_string("infotext", S("Chest"))
|
meta:set_string("infotext", S("Chest"))
|
||||||
meta:set_string("version", "2")
|
meta:set_string("version", VER)
|
||||||
end
|
end
|
||||||
|
|
||||||
meta:get_inventory():set_size("main", 9*3)
|
meta:get_inventory():set_size("main", 9*3)
|
||||||
@ -132,8 +133,7 @@ local function on_destruct(pos, large)
|
|||||||
local pos2 = {x = pos.x + nghbr_p.x, y = pos.y, z = pos.z + nghbr_p.z}
|
local pos2 = {x = pos.x + nghbr_p.x, y = pos.y, z = pos.z + nghbr_p.z}
|
||||||
local name = minetest.get_node(pos2).name
|
local name = minetest.get_node(pos2).name
|
||||||
|
|
||||||
if (right and name == "default:chest_left")
|
if (right and name == "default:chest_left") or name == "default:chest_right" then
|
||||||
or name == "default:chest_right" then
|
|
||||||
local meta = minetest.get_meta(pos2)
|
local meta = minetest.get_meta(pos2)
|
||||||
meta:set_string("formspec", chest_formspec)
|
meta:set_string("formspec", chest_formspec)
|
||||||
meta:set_string("infotext", S("Chest"))
|
meta:set_string("infotext", S("Chest"))
|
||||||
@ -227,31 +227,21 @@ minetest.register_craft({
|
|||||||
burntime = 15
|
burntime = 15
|
||||||
})
|
})
|
||||||
|
|
||||||
-- LBM for updating Chest
|
-- LBM for updating Chests
|
||||||
minetest.register_lbm({
|
minetest.register_lbm({
|
||||||
label = "Chest updater",
|
label = "Chest updater",
|
||||||
name = "default:chest_updater_v2",
|
name = "default:chest_updater_v" .. VER,
|
||||||
nodenames = "default:chest",
|
nodenames = {"default:chest", "default:chest_left", "default:chest_right"},
|
||||||
action = function(pos)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
if meta:get_string("version") ~= "2" then
|
|
||||||
meta:set_string("formspec", chest_formspec)
|
|
||||||
meta:set_string("version", "2")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_lbm({
|
|
||||||
label = "Chest updater (large)",
|
|
||||||
name = "default:chest_large_updater",
|
|
||||||
nodenames = {"default:chest_left", "default:chest_right"},
|
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if meta:get_string("version") ~= "2" then
|
if meta:get_string("version") == VER then return end
|
||||||
local param2 = minetest.get_node(pos).param2
|
|
||||||
local nparam2 = neighbor[param2]
|
|
||||||
|
|
||||||
if node.name == "default:chest_left" then
|
local nname = node.name
|
||||||
|
if nname == "default:chest" then
|
||||||
|
meta:set_string("formspec", chest_formspec)
|
||||||
|
|
||||||
|
elseif nname == "default:chest_left" then
|
||||||
|
local nparam2 = neighbor[node.param2]
|
||||||
local pos_r = {x = pos.x + nparam2[1].x, y = pos.y, z = pos.z + nparam2[1].z}
|
local pos_r = {x = pos.x + nparam2[1].x, y = pos.y, z = pos.z + nparam2[1].z}
|
||||||
local chest_l = pos_r.x .. "," .. pos_r.y .. "," .. pos_r.z
|
local chest_l = pos_r.x .. "," .. pos_r.y .. "," .. pos_r.z
|
||||||
|
|
||||||
@ -260,7 +250,9 @@ minetest.register_lbm({
|
|||||||
"list[current_name;main;0.01,0.85;9,3;]" ..
|
"list[current_name;main;0.01,0.85;9,3;]" ..
|
||||||
"listring[nodemeta:" .. chest_l .. ";main]"
|
"listring[nodemeta:" .. chest_l .. ";main]"
|
||||||
meta:set_string("formspec", formspec_l)
|
meta:set_string("formspec", formspec_l)
|
||||||
elseif node.name == "default:chest_right" then
|
|
||||||
|
elseif nname == "default:chest_right" then
|
||||||
|
local nparam2 = neighbor[node.param2]
|
||||||
local pos_l = {x = pos.x + nparam2[2].x, y = pos.y, z = pos.z + nparam2[2].z}
|
local pos_l = {x = pos.x + nparam2[2].x, y = pos.y, z = pos.z + nparam2[2].z}
|
||||||
local chest_r = pos_l.x .. "," .. pos_l.y .. "," .. pos_l.z
|
local chest_r = pos_l.x .. "," .. pos_l.y .. "," .. pos_l.z
|
||||||
|
|
||||||
@ -271,7 +263,6 @@ minetest.register_lbm({
|
|||||||
meta:set_string("formspec", formspec_r)
|
meta:set_string("formspec", formspec_r)
|
||||||
end
|
end
|
||||||
|
|
||||||
meta:set_string("version", "2")
|
meta:set_string("version", VER)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
@ -342,7 +342,6 @@ minetest.register_craft({
|
|||||||
burntime = 15
|
burntime = 15
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "fuel",
|
type = "fuel",
|
||||||
recipe = "default:vine",
|
recipe = "default:vine",
|
||||||
@ -363,22 +362,10 @@ minetest.register_craft({
|
|||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "fuel",
|
type = "fuel",
|
||||||
recipe = "default:bush_stem",
|
recipe = "group:bush_stem",
|
||||||
burntime = 7
|
burntime = 7
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "fuel",
|
|
||||||
recipe = "default:acacia_bush_stem",
|
|
||||||
burntime = 8
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "fuel",
|
|
||||||
recipe = "default:pine_bush_stem",
|
|
||||||
burntime = 6
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "fuel",
|
type = "fuel",
|
||||||
recipe = "default:junglegrass",
|
recipe = "default:junglegrass",
|
||||||
|
@ -1161,8 +1161,8 @@ minetest.register_node("default:junglegrass", {
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1,
|
groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1,
|
||||||
dig_immediate = 2},
|
junglegrass = 1, flammable = 1, dig_immediate = 2},
|
||||||
sounds = default.node_sound_leaves_defaults({
|
sounds = default.node_sound_leaves_defaults({
|
||||||
dig = {name = "default_dig_snappy", gain = 0.5}
|
dig = {name = "default_dig_snappy", gain = 0.5}
|
||||||
}),
|
}),
|
||||||
@ -1194,8 +1194,8 @@ minetest.register_node("default:grass_1", {
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1,
|
groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1,
|
||||||
grass = 1, dig_immediate = 3},
|
normal_grass = 1, flammable = 1, dig_immediate = 3},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -1218,8 +1218,9 @@ for i = 2, 5 do
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
drop = "default:grass_1",
|
drop = "default:grass_1",
|
||||||
groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1,
|
groups = {snappy = 3, flora = 1, attached_node = 1,
|
||||||
grass = 1, dig_immediate = 3, not_in_creative_inventory = 1},
|
not_in_creative_inventory = 1, grass = 1,
|
||||||
|
normal_grass = 1, flammable = 1, dig_immediate = 3},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -1240,8 +1241,9 @@ minetest.register_node("default:grass", {
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
drop = "default:grass_1",
|
drop = "default:grass_1",
|
||||||
groups = {snappy = 3, flora = 1, attached_node = 1, flammable = 1,
|
groups = {snappy = 3, flora = 1, attached_node = 1,
|
||||||
grass = 1, dig_immediate = 3, not_in_creative_inventory = 1},
|
not_in_creative_inventory = 1, grass = 1,
|
||||||
|
normal_grass = 1, flammable = 1, dig_immediate = 3},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
|
||||||
on_place = grass_place
|
on_place = grass_place
|
||||||
@ -1278,8 +1280,8 @@ minetest.register_node("default:dry_grass_1", {
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
|
groups = {snappy = 3, flammable = 3, flora = 1,
|
||||||
dry_grass = 1, dig_immediate = 3},
|
attached_node = 1, grass = 1, dry_grass = 1, dig_immediate = 2},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -1302,7 +1304,7 @@ for i = 2, 5 do
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
|
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
|
||||||
dry_grass = 1, not_in_creative_inventory = 1},
|
not_in_creative_inventory = 1, grass = 1, dry_grass = 1, dig_immediate = 2},
|
||||||
drop = "default:dry_grass_1",
|
drop = "default:dry_grass_1",
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
@ -1324,7 +1326,7 @@ minetest.register_node("default:dry_grass", {
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
|
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
|
||||||
dry_grass = 1, dig_immediate = 3, not_in_creative_inventory = 1},
|
not_in_creative_inventory = 1, grass = 1, dry_grass = 1, dig_immediate = 2},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
|
||||||
on_place = dry_grass_place
|
on_place = dry_grass_place
|
||||||
@ -1380,8 +1382,8 @@ for i = 2, 3 do
|
|||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
groups = {snappy = 3, flammable = 3, flora = 1, grass = 1,
|
groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
|
||||||
fern = 1, attached_node = 1, not_in_creative_inventory = 1},
|
grass = 1, fern = 1, not_in_creative_inventory = 1},
|
||||||
drop = "default:fern_1",
|
drop = "default:fern_1",
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
@ -1401,7 +1403,7 @@ minetest.register_node("default:bush_stem", {
|
|||||||
wield_image = "default_bush_stem.png",
|
wield_image = "default_bush_stem.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, bush_stem = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -1473,7 +1475,7 @@ minetest.register_node("default:blueberry_bush_stem", {
|
|||||||
wield_image = "default_blueberry_bush_stem.png",
|
wield_image = "default_blueberry_bush_stem.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, bush_stem = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -1577,7 +1579,7 @@ minetest.register_node("default:acacia_bush_stem", {
|
|||||||
wield_image = "default_acacia_bush_stem.png",
|
wield_image = "default_acacia_bush_stem.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, bush_stem = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -1649,7 +1651,7 @@ minetest.register_node("default:pine_bush_stem", {
|
|||||||
wield_image = "default_pine_bush_stem.png",
|
wield_image = "default_pine_bush_stem.png",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, bush_stem = 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -2504,6 +2506,12 @@ default.register_leafdecay({
|
|||||||
radius = 3
|
radius = 3
|
||||||
})
|
})
|
||||||
|
|
||||||
|
default.register_leafdecay({
|
||||||
|
trunks = {"default:cherry_blossom_tree"},
|
||||||
|
leaves = {"default:cherry_blossom_leaves"},
|
||||||
|
radius = 3
|
||||||
|
})
|
||||||
|
|
||||||
default.register_leafdecay({
|
default.register_leafdecay({
|
||||||
trunks = {"default:bush_stem"},
|
trunks = {"default:bush_stem"},
|
||||||
leaves = {"default:bush_leaves"},
|
leaves = {"default:bush_leaves"},
|
||||||
@ -2523,7 +2531,7 @@ default.register_leafdecay({
|
|||||||
})
|
})
|
||||||
|
|
||||||
default.register_leafdecay({
|
default.register_leafdecay({
|
||||||
trunks = {"default:cherry_blossom_tree"},
|
trunks = {"default:blueberry_bush_stem"},
|
||||||
leaves = {"default:cherry_blossom_leaves"},
|
leaves = {"default:blueberry_bush_leaves"},
|
||||||
radius = 3
|
radius = 1
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user