add node dig/placement predictions (#34)

This commit is contained in:
fluxionary 2022-11-04 09:29:34 -07:00 committed by GitHub
parent 438a1adb32
commit 1894d91609
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,6 +174,13 @@ for i, bush_name in ipairs(bushes_classic.bushes) do
texture_bottom = "bushes_bush_bottom.png" texture_bottom = "bushes_bush_bottom.png"
end end
local node_dig_prediction
local node_placement_prediction
if bush_name ~= "fruitless" then
node_dig_prediction = "bushes:fruitless_bush"
node_placement_prediction = "bushes:fruitless_bush"
end
minetest.register_node(":bushes:" .. bush_name .. "_bush", { minetest.register_node(":bushes:" .. bush_name .. "_bush", {
description = bushes_classic.bushes_descriptions[i][6], description = bushes_classic.bushes_descriptions[i][6],
drawtype = "mesh", drawtype = "mesh",
@ -185,6 +192,8 @@ for i, bush_name in ipairs(bushes_classic.bushes) do
groups = groups, groups = groups,
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
drop = "", drop = "",
node_dig_prediction = node_dig_prediction,
node_placement_prediction = node_placement_prediction,
after_dig_node = function( pos, oldnode, oldmetadata, digger ) after_dig_node = function( pos, oldnode, oldmetadata, digger )
return plantlife_bushes.after_dig_node(pos, oldnode, oldmetadata, digger); return plantlife_bushes.after_dig_node(pos, oldnode, oldmetadata, digger);
end, end,