Okay, this time I actually fixed it
This commit is contained in:
parent
a11cb7895d
commit
ac6954fe22
4
lib.lua
4
lib.lua
@ -180,8 +180,8 @@ end
|
||||
|
||||
-- Inverse of get_internal_identifier - parses that kind of string into ID/meta/NBT
|
||||
local function string_to_item(s)
|
||||
local mod, item, meta, NBT = string.match(s, "([A-Za-z0-9_]+):([A-Za-z0-9_]):([0-9]+)#([0-9a-f]+)")
|
||||
if not NBT then mod, item, meta = string.match(s, "([A-Za-z0-9_]):([A-Za-z0-9_]):([0-9]+)") end
|
||||
local mod, item, meta, NBT = string.match(s, "([A-Za-z0-9_]+):([A-Za-z0-9_]+):([0-9]+)#([0-9a-f]+)")
|
||||
if not NBT then mod, item, meta = string.match(s, "([A-Za-z0-9_]+):([A-Za-z0-9_]+):([0-9]+)") end
|
||||
if not mod or not item or not meta then error(errors.make(errors.INTERNAL, "string did not match regex")) end
|
||||
return { ID = mod .. ":" .. item, meta = tonumber(meta), NBT = NBT }
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user