mirror of
https://github.com/minetest-mods/jumping.git
synced 2024-11-25 16:43:46 +01:00
use swap_node instead of add_node
This commit is contained in:
parent
5559e591a7
commit
dd985c9a80
4
init.lua
4
init.lua
@ -21,7 +21,7 @@ local trampoline_punch = function(pos, node)
|
|||||||
local id = string.sub(node.name, #node.name)
|
local id = string.sub(node.name, #node.name)
|
||||||
if id < "6" then
|
if id < "6" then
|
||||||
id = id + 1
|
id = id + 1
|
||||||
minetest.add_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
|
minetest.swap_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
|
||||||
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id)
|
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -30,7 +30,7 @@ local power_decrease = function(pos, node)
|
|||||||
local id = string.sub(node.name, #node.name)
|
local id = string.sub(node.name, #node.name)
|
||||||
if id > "1" then
|
if id > "1" then
|
||||||
id = id - 1
|
id = id - 1
|
||||||
minetest.add_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
|
minetest.swap_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
|
||||||
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id)
|
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user