mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-04 08:43:45 +01:00
Merge pull request 'Fix redstone ore not calling on_punchnode callbacks' (#2827) from fix_redstone_punchnode into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2827
commit
dc039e31b6
@ -88,10 +88,13 @@ minetest.register_node("mcl_core:stone_with_gold", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
local redstone_timer = 68.28
|
local redstone_timer = 68.28
|
||||||
local function redstone_ore_activate(pos)
|
local function redstone_ore_activate(pos, node, puncher, pointed_thing)
|
||||||
minetest.swap_node(pos, {name="mcl_core:stone_with_redstone_lit"})
|
minetest.swap_node(pos, {name="mcl_core:stone_with_redstone_lit"})
|
||||||
local t = minetest.get_node_timer(pos)
|
local t = minetest.get_node_timer(pos)
|
||||||
t:start(redstone_timer)
|
t:start(redstone_timer)
|
||||||
|
if puncher and pointed_thing then
|
||||||
|
return minetest.node_punch(pos, node, puncher, pointed_thing)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
minetest.register_node("mcl_core:stone_with_redstone", {
|
minetest.register_node("mcl_core:stone_with_redstone", {
|
||||||
description = S("Redstone Ore"),
|
description = S("Redstone Ore"),
|
||||||
@ -126,9 +129,12 @@ minetest.register_node("mcl_core:stone_with_redstone", {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
local function redstone_ore_reactivate(pos)
|
local function redstone_ore_reactivate(pos, node, puncher, pointed_thing)
|
||||||
local t = minetest.get_node_timer(pos)
|
local t = minetest.get_node_timer(pos)
|
||||||
t:start(redstone_timer)
|
t:start(redstone_timer)
|
||||||
|
if puncher and pointed_thing then
|
||||||
|
return minetest.node_punch(pos, node, puncher, pointed_thing)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- Light the redstone ore up when it has been touched
|
-- Light the redstone ore up when it has been touched
|
||||||
minetest.register_node("mcl_core:stone_with_redstone_lit", {
|
minetest.register_node("mcl_core:stone_with_redstone_lit", {
|
||||||
|
@ -116,15 +116,21 @@ end
|
|||||||
|
|
||||||
local redstone_timer = 68.28
|
local redstone_timer = 68.28
|
||||||
|
|
||||||
local function redstone_ore_activate(pos)
|
local function redstone_ore_activate(pos, node, puncher, pointed_thing)
|
||||||
minetest.swap_node(pos, { name = "mcl_deepslate:deepslate_with_redstone_lit" })
|
minetest.swap_node(pos, { name = "mcl_deepslate:deepslate_with_redstone_lit" })
|
||||||
local t = minetest.get_node_timer(pos)
|
local t = minetest.get_node_timer(pos)
|
||||||
t:start(redstone_timer)
|
t:start(redstone_timer)
|
||||||
|
if puncher and pointed_thing then
|
||||||
|
return minetest.node_punch(pos, node, puncher, pointed_thing)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function redstone_ore_reactivate(pos)
|
local function redstone_ore_reactivate(pos, node, puncher, pointed_thing)
|
||||||
local t = minetest.get_node_timer(pos)
|
local t = minetest.get_node_timer(pos)
|
||||||
t:start(redstone_timer)
|
t:start(redstone_timer)
|
||||||
|
if puncher and pointed_thing then
|
||||||
|
return minetest.node_punch(pos, node, puncher, pointed_thing)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_node("mcl_deepslate:deepslate_with_redstone", {
|
minetest.register_node("mcl_deepslate:deepslate_with_redstone", {
|
||||||
|
Loading…
Reference in New Issue
Block a user