143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
::skip::end
return sorcery.matreg.lookup[item:get_name()], eligible
else return nil end
end
local key = 'sorcery_enchantment_recs'
sorcery.enchant.set = function(stack, data, noup)
local meta = stack:get_meta()
meta:set_string(key, sorcery.lib.str.meta_armor(pack(data),true))
if not noup then stack=sorcery.enchant.stackup(stack) end
end
sorcery.enchant.get = function(stack)
local meta = stack:get_meta()
if meta:contains(key) then
local data = sorcery.lib.str.meta_dearmor(meta:get_string(key),true)
return unpack(data)
|
|
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
::skip::end
return sorcery.matreg.lookup[item:get_name()], eligible
else return nil end
end
local key = 'sorcery_enchantment_recs'
sorcery.enchant.set = function(stack, data, noup)
local meta = stack:get_meta()
if data then
meta:set_string(key, sorcery.lib.str.meta_armor(pack(data),true))
else
meta:set_string(key, '')
end
if not noup then stack=sorcery.enchant.stackup(stack) end
end
sorcery.enchant.get = function(stack)
local meta = stack:get_meta()
if meta:contains(key) then
local data = sorcery.lib.str.meta_dearmor(meta:get_string(key),true)
return unpack(data)
|