Replace the horribly outdated minetest.env stuff

This commit is contained in:
Wuzzy 2017-01-11 18:21:46 +01:00
parent c13823bcfc
commit bc0879911f
35 changed files with 335 additions and 335 deletions

View file

@ -7,12 +7,12 @@ minetest.register_node("mesecons_noteblock:noteblock", {
paramtype="light",
is_ground_content = false,
after_place_node = function(pos)
minetest.env:add_node(pos, {name="mesecons_noteblock:noteblock", param2=0})
minetest.add_node(pos, {name="mesecons_noteblock:noteblock", param2=0})
end,
on_punch = function (pos, node) -- change sound when punched
local param2 = node.param2+1
if param2==12 then param2=0 end
minetest.env:add_node(pos, {name = node.name, param2 = param2})
minetest.add_node(pos, {name = node.name, param2 = param2})
mesecon.noteblock_play(pos, param2)
end,
sounds = default.node_sound_wood_defaults(),
@ -65,7 +65,7 @@ mesecon.noteblock_play = function (pos, param2)
elseif param2==7 then
soundname="mesecons_noteblock_gsharp"
end
local block_below_name = minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
local block_below_name = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
if block_below_name == "default:glass" then
soundname="mesecons_noteblock_hihat"
end