forked from minetest-mods/mesecons
Avoid deprecated item metadata accessors (#630)
This commit is contained in:
parent
60240ba268
commit
edcdc6817e
@ -65,8 +65,7 @@ describe("FPGA rotation", function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- mineunit does not support deprecated ItemStack:get_metadata()
|
describe("FPGA programmer", function()
|
||||||
pending("FPGA programmer", function()
|
|
||||||
local pos2 = {x = 10, y = 0, z = 0}
|
local pos2 = {x = 10, y = 0, z = 0}
|
||||||
|
|
||||||
before_each(function()
|
before_each(function()
|
||||||
|
@ -23,7 +23,7 @@ minetest.register_tool("mesecons_fpga:programmer", {
|
|||||||
minetest.sound_play("mesecons_fpga_fail", { pos = placer:get_pos(), gain = 0.1, max_hear_distance = 4 }, true)
|
minetest.sound_play("mesecons_fpga_fail", { pos = placer:get_pos(), gain = 0.1, max_hear_distance = 4 }, true)
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
itemstack:set_metadata(meta:get_string("instr"))
|
itemstack:get_meta():set_string("", meta:get_string("instr"))
|
||||||
minetest.chat_send_player(placer:get_player_name(), "FPGA gate configuration was successfully copied!")
|
minetest.chat_send_player(placer:get_player_name(), "FPGA gate configuration was successfully copied!")
|
||||||
minetest.sound_play("mesecons_fpga_copy", { pos = placer:get_pos(), gain = 0.1, max_hear_distance = 4 }, true)
|
minetest.sound_play("mesecons_fpga_copy", { pos = placer:get_pos(), gain = 0.1, max_hear_distance = 4 }, true)
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ minetest.register_tool("mesecons_fpga:programmer", {
|
|||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
local imeta = itemstack:get_metadata()
|
local imeta = itemstack:get_meta():get_string("")
|
||||||
if imeta == "" then
|
if imeta == "" then
|
||||||
minetest.chat_send_player(player_name, "Use shift+right-click to copy a gate configuration first.")
|
minetest.chat_send_player(player_name, "Use shift+right-click to copy a gate configuration first.")
|
||||||
minetest.sound_play("mesecons_fpga_fail", { pos = user:get_pos(), gain = 0.1, max_hear_distance = 4 }, true)
|
minetest.sound_play("mesecons_fpga_fail", { pos = user:get_pos(), gain = 0.1, max_hear_distance = 4 }, true)
|
||||||
|
Loading…
Reference in New Issue
Block a user