mirror of
https://github.com/minetest-mods/jumping.git
synced 2024-11-22 07:03:48 +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)
|
||||
if id < "6" then
|
||||
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)
|
||||
end
|
||||
end
|
||||
@ -30,7 +30,7 @@ local power_decrease = function(pos, node)
|
||||
local id = string.sub(node.name, #node.name)
|
||||
if id > "1" then
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user