From 574bc761091c710bf0da70be02716285f94f9900 Mon Sep 17 00:00:00 2001 From: osmarks Date: Tue, 14 Aug 2018 22:39:29 +0100 Subject: [PATCH] allow different regex --- lib.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lib.lua b/lib.lua index 072b9b2..113deb6 100644 --- a/lib.lua +++ b/lib.lua @@ -180,6 +180,7 @@ 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+):(%a+):([0-9]+)#([0-9a-f]+)") + if not NBT then mod, item, meta = string.match(s, "(%a+):(%a+):([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 = meta, NBT = NBT } end