Avoid deprecated item metadata accessors (#630)

This commit is contained in:
Jude Melton-Houghton
2022-12-15 12:43:08 -05:00
committed by GitHub
父節點 60240ba268
當前提交 edcdc6817e
共有 2 個文件被更改,包括 3 次插入4 次删除

查看文件

@ -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)
return itemstack
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.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
end
local imeta = itemstack:get_metadata()
local imeta = itemstack:get_meta():get_string("")
if imeta == "" then
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)