Fix register_liquid for mods and submods using same namespace

a fix allowing to use itemname with colon prefix when doing register_liquid
This commit is contained in:
Petras Jokubauskas 2025-06-06 09:40:40 +02:00 committed by GitHub
parent 0351c66915
commit dde7f13ac9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -148,6 +148,11 @@ 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