From 0f4fe2bb81efe428c69dbc6ba19f12471b13bcd7 Mon Sep 17 00:00:00 2001 From: Cody Young Date: Tue, 21 Mar 2023 13:32:56 -0500 Subject: [PATCH] Add NBT custom name lookup --- test-programs/logistics-pipes/pipe_driver.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test-programs/logistics-pipes/pipe_driver.lua b/test-programs/logistics-pipes/pipe_driver.lua index c283d53..01cf1b4 100644 --- a/test-programs/logistics-pipes/pipe_driver.lua +++ b/test-programs/logistics-pipes/pipe_driver.lua @@ -20,6 +20,13 @@ local function ItemStack_new(item) end function ItemStack:getName() + --- check for custom name + if self.data.hasTagCompount() then + local nbt = self.data.getTagCompount() + if nbt.value.display and nbt.value.display.value.Name then + return nbt.value.display.value.Name.value + end + end return self.data.getName() end