From 312f49932532fe0f7e8499897482c5a11881ca4d Mon Sep 17 00:00:00 2001 From: Petras Jokubauskas Date: Fri, 6 Jun 2025 12:49:40 +0200 Subject: [PATCH] change implementation of fix corrected stored itemname as soon registter_craftitem is called --- mods/bucket/init.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mods/bucket/init.lua b/mods/bucket/init.lua index 62720d59..d8793175 100644 --- a/mods/bucket/init.lua +++ b/mods/bucket/init.lua @@ -116,6 +116,10 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name return ItemStack("bucket:bucket_empty") end }) + if itemname:sub(1,1) == ":" then + -- If the itemname starts with a colon, correct that + bucket.liquids[source]["itemname"] = itemname:sub(2) + end end end @@ -148,11 +152,6 @@ minetest.register_craftitem("bucket:bucket_empty", { -- default set to return filled bucket local giving_back = liquiddef.itemname - if giving_back:sub(1,1) == ":" then - --overwrite with removed prepending colon if present in itemname - --for cases where mods and submods use the same namespace - giving_back = giving_back:sub(2) - end -- check if holding more than 1 empty bucket if item_count > 1 then