Add getId function
This commit is contained in:
parent
c40bdb5a09
commit
73dab0efac
|
@ -23,13 +23,24 @@ function ItemStack:getName()
|
|||
--- check for custom name
|
||||
if self.data.hasTagCompound() then
|
||||
local nbt = self.data.getTagCompound()
|
||||
if nbt.value.display and nbt.value.display.value.Name then
|
||||
-- if Long arry is in the NBT complex logistic pipes fails to
|
||||
-- serialize the NBT resulting in a empty nbt
|
||||
if not nbt then
|
||||
return self.data.getName() .. " <NBT ERROR>"
|
||||
elseif nbt.value.display and nbt.value.display.value.Name then
|
||||
return nbt.value.display.value.Name.value
|
||||
end
|
||||
end
|
||||
return self.data.getName()
|
||||
end
|
||||
|
||||
function ItemStack:getId()
|
||||
if not self.data.hasTagCompound() then
|
||||
return self.data.getIdName() .. "." .. self.data.getData()
|
||||
end
|
||||
return "complex"
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
----------------------------- ItemCollection Class -----------------------------
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue