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