From 73dab0efac29c295bf64bcbd635b6d996ccd87a5 Mon Sep 17 00:00:00 2001 From: Cody Young Date: Sun, 26 Mar 2023 15:18:38 -0500 Subject: [PATCH] Add getId function --- test-programs/logistics-pipes/pipe_driver.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test-programs/logistics-pipes/pipe_driver.lua b/test-programs/logistics-pipes/pipe_driver.lua index 86e2920..5b98035 100644 --- a/test-programs/logistics-pipes/pipe_driver.lua +++ b/test-programs/logistics-pipes/pipe_driver.lua @@ -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() .. " " + 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 ----------------------------- --------------------------------------------------------------------------------