Merge remote-tracking branch 'upstream/master'

This commit is contained in:
bri cassa 2021-06-20 17:27:50 +02:00
commit 637f96e215
4 changed files with 74 additions and 51 deletions

View File

@ -28,7 +28,7 @@ node_box = {
{-0.0612,-0.500000,-0.500000,0.0612,0.500000,-0.375000}, --NodeBox 1 {-0.0612,-0.500000,-0.500000,0.0612,0.500000,-0.375000}, --NodeBox 1
} }
}, },
groups = {snappy=3,flammable=2}, groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'default:stick' drop = 'default:stick'
}) })
@ -63,7 +63,8 @@ for i in pairs(BushBranchCenter) do
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks -- tree=1, -- MM: disabled because some recipes use group:tree for trunks
snappy=3, snappy=3,
flammable=2, flammable=2,
leaves=1 leaves=1,
attached_node=1
}, },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'default:stick 4' drop = 'default:stick 4'
@ -106,7 +107,8 @@ for i in pairs(BushBranchSide) do
-- tree=1, -- MM: disabled because some recipes use group:tree for trunks -- tree=1, -- MM: disabled because some recipes use group:tree for trunks
snappy=3, snappy=3,
flammable=2, flammable=2,
leaves=1 leaves=1,
attached_node=1
}, },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'default:stick 3' drop = 'default:stick 3'

View File

@ -87,19 +87,34 @@ minetest.register_node("cavestuff:stalactite_1",{
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.187500,0.425000,-0.150003,0.162500,0.500000,0.162500}, {-0.187500,-0.425000,-0.150003,0.162500,-0.500000,0.162500},
{-0.112500,0.162500,-0.100000,0.087500,0.475000,0.087500}, {-0.112500,-0.162500,-0.100000,0.087500,-0.475000,0.087500},
{-0.062500,-0.275000,-0.062500,0.062500,0.500000,0.062500}, {-0.062500,0.275000,-0.062500,0.062500,-0.500000,0.062500},
{-0.037500,-0.837500,0.037500,0.037500,0.500000,-0.025000}, {-0.037500,0.837500,0.037500,0.037500,-0.500000,-0.025000},
} }
}, },
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local pt = pointed_thing local dir = vector.subtract(pointed_thing.above, pointed_thing.under)
if minetest.get_node(pt.under).name=="default:stone" local base = pointed_thing.under
and minetest.get_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}).name=="air" local place = vector.add(base, dir)
and minetest.get_node({x=pt.under.x, y=pt.under.y-2, z=pt.under.z}).name=="air" then local above = vector.add(place, dir)
minetest.swap_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}, {name="cavestuff:stalactite_"..random(1,3)})
if not placer then return end
local playername = placer:get_player_name()
if minetest.is_protected(place, playername)
or minetest.is_protected(above, playername) then
minetest.record_protection_violation(place, playername)
return
end
if minetest.get_node(base).name == "default:stone"
and minetest.get_node(place).name == "air"
and minetest.get_node(above).name == "air"
then
minetest.swap_node(place, {
name = "cavestuff:stalactite_"..math.random(1,3),
param2 = minetest.dir_to_wallmounted(vector.multiply(dir, -1))
})
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
itemstack:take_item() itemstack:take_item()
end end
@ -118,10 +133,10 @@ minetest.register_node("cavestuff:stalactite_2",{
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.187500,0.387500,-0.150003,0.162500,0.500000,0.162500}, {-0.187500,-0.387500,-0.150003,0.162500,-0.500000,0.162500},
{-0.112500,0.112500,-0.100000,0.087500,0.475000,0.087500}, {-0.112500,-0.112500,-0.100000,0.087500,-0.475000,0.087500},
{-0.062500,-0.675000,-0.062500,0.062500,0.500000,0.062500}, {-0.062500,0.675000,-0.062500,0.062500,-0.500000,0.062500},
{-0.037500,-0.975000,0.037500,0.037500,0.500000,-0.025000}, {-0.037500,0.975000,0.037500,0.037500,-0.500000,-0.025000},
} }
}, },
}) })
@ -136,10 +151,10 @@ minetest.register_node("cavestuff:stalactite_3",{
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.187500,0.387500,-0.150003,0.162500,0.500000,0.162500}, {-0.187500,-0.387500,-0.150003,0.162500,-0.500000,0.162500},
{-0.112500,0.037500,-0.100000,0.087500,0.475000,0.087500}, {-0.112500,-0.037500,-0.100000,0.087500,-0.475000,0.087500},
{-0.062500,-0.437500,-0.062500,0.062500,0.500000,0.062500}, {-0.062500,0.437500,-0.062500,0.062500,-0.500000,0.062500},
{-0.037500,-1.237500,0.037500,0.037500,0.500000,-0.025000}, {-0.037500,1.237500,0.037500,0.037500,-0.500000,-0.025000},
} }
}, },
}) })

View File

@ -362,13 +362,19 @@ for i in pairs(TRuNKS) do
snappy=1, snappy=1,
choppy=2, choppy=2,
oddly_breakable_by_hand=1, oddly_breakable_by_hand=1,
flammable=2--, flammable=2,
--not_in_creative_inventory=1 -- atm in inv for testing --not_in_creative_inventory=1 -- atm in inv for testing
}, },
--drop = "trunks:twig_1", -- not sure about this yet --drop = "trunks:twig_1", -- not sure about this yet
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
default.register_leafdecay({
trunks = { MoD..":"..TRuNK },
leaves = { "trunks:"..TRuNK.."root" },
radius = 1,
})
else else
minetest.log("error", string.format("[Trunks] warning: tree type '%s:%s' not found", MoD, TRuNK)) minetest.log("error", string.format("[Trunks] warning: tree type '%s:%s' not found", MoD, TRuNK))
end end

View File

@ -42,7 +42,7 @@ minetest.register_node("youngtrees:youngtree2_middle",{
{-0.500000,0.125000,-0.500000,0.500000,0.500000,0.500000}, --NodeBox 3 {-0.500000,0.125000,-0.500000,0.500000,0.500000,0.500000}, --NodeBox 3
} }
}, },
groups = {snappy=3,flammable=2}, groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'trunks:twig_1' drop = 'trunks:twig_1'
}) })
@ -60,7 +60,7 @@ minetest.register_node("youngtrees:youngtree_top", {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
}, },
groups = {snappy=3,flammable=2}, groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'trunks:twig_1' drop = 'trunks:twig_1'
}) })
@ -79,7 +79,7 @@ minetest.register_node("youngtrees:youngtree_middle", {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
}, },
groups = {snappy=3,flammable=2}, groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'trunks:twig_1' drop = 'trunks:twig_1'
}) })
@ -99,7 +99,7 @@ minetest.register_node("youngtrees:youngtree_bottom", {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
}, },
groups = {snappy=3,flammable=2}, groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = 'trunks:twig_1' drop = 'trunks:twig_1'
}) })