Skip to content

Commit

Permalink
Replace deprecated ItemStack:get_metadata() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklp09 committed Jan 2, 2025
1 parent d756597 commit 72b33ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit 72b33ca

Please sign in to comment.