mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 22:33:16 -04:00
Merge a87b4a8e65
into c1cd24c378
This commit is contained in:
commit
e56b2398f0
2 changed files with 13 additions and 2 deletions
|
@ -284,7 +284,7 @@ minetest.register_abm({
|
||||||
-- Drop stuff other than the node itself
|
-- Drop stuff other than the node itself
|
||||||
itemstacks = minetest.get_node_drops(n0.name)
|
itemstacks = minetest.get_node_drops(n0.name)
|
||||||
for _, itemname in ipairs(itemstacks) do
|
for _, itemname in ipairs(itemstacks) do
|
||||||
if itemname ~= n0.name then
|
if itemname == "default:apple" or itemname ~= n0.name then
|
||||||
local p_drop = {
|
local p_drop = {
|
||||||
x = p0.x - 0.5 + math.random(),
|
x = p0.x - 0.5 + math.random(),
|
||||||
y = p0.y - 0.5 + math.random(),
|
y = p0.y - 0.5 + math.random(),
|
||||||
|
@ -299,3 +299,14 @@ minetest.register_abm({
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--leaves and apple do not decay when placed by player
|
||||||
|
minetest.register_on_placenode(function(pos, newnode, placer, oldnode)
|
||||||
|
if placer:is_player() then
|
||||||
|
local d = minetest.registered_nodes[newnode.name].groups.leafdecay
|
||||||
|
if d or not d == 0 then
|
||||||
|
newnode.param2 = 1
|
||||||
|
minetest.env:set_node(pos, newnode)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
|
@ -1124,7 +1124,7 @@ minetest.register_node("default:apple", {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
|
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
|
||||||
},
|
},
|
||||||
groups = {fleshy=3,dig_immediate=3,flammable=2},
|
groups = {fleshy=3,leafdecay=3,dig_immediate=3,flammable=2},
|
||||||
on_use = minetest.item_eat(4),
|
on_use = minetest.item_eat(4),
|
||||||
sounds = default.node_sound_defaults(),
|
sounds = default.node_sound_defaults(),
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue