Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated ItemStack:get_metadata() calls #390

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions technic/tools/cans.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ local function set_can_wear(itemstack, level, max_level)
end

local function get_can_level(itemstack)
if itemstack:get_metadata() == "" then
if itemstack:get_meta():get_string("") == "" then
return 0
else
return tonumber(itemstack:get_metadata())
return tonumber(itemstack:get_meta():get_string(""))
end
end

Expand Down
2 changes: 1 addition & 1 deletion technic_chests/digilines.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local function item_matches(item, stack)
and (not item.wear or (type(item.wear) == "number" and wear == item.wear) or (type(item.wear) == "table"
and (not item.wear[1] or (type(item.wear[1]) == "number" and item.wear[1] <= wear))
and (not item.wear[2] or (type(item.wear[2]) == "number" and wear < item.wear[2]))))
and (not item.metadata or (type(item.metadata) == "string" and stack:get_metadata() == item.metadata))
and (not item.metadata or (type(item.metadata) == "string" and stack:get_meta():get_string("") == item.metadata))
end

function technic.chests.digiline_effector(pos, _, channel, msg)
Expand Down
2 changes: 1 addition & 1 deletion technic_chests/inventory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function technic.chests.sort_inv(inv, mode)
if not stack:is_empty() then
local name = stack:get_name()
local wear = stack:get_wear()
local meta = stack:get_metadata()
local meta = stack:get_meta():get_string("")
local count = stack:get_count()
local def = minetest.registered_items[name]
local itemtype = (def and itemtypes[def.type]) and def.type or "none"
Expand Down
Loading