mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-07-04 13:47:12 -04:00
itemname_raw for reg_craftitem only
This commit is contained in:
parent
b6910cdbd4
commit
142b4d85db
1 changed files with 4 additions and 2 deletions
|
@ -51,16 +51,18 @@ end
|
||||||
-- This function can be called from any mod (that depends on bucket).
|
-- This function can be called from any mod (that depends on bucket).
|
||||||
function bucket.register_liquid(source, flowing, itemname, inventory_image, name,
|
function bucket.register_liquid(source, flowing, itemname, inventory_image, name,
|
||||||
groups, force_renew)
|
groups, force_renew)
|
||||||
|
local itemname_raw = itemname
|
||||||
|
itemname = itemname:match(":(.+)") or itemname
|
||||||
bucket.liquids[source] = {
|
bucket.liquids[source] = {
|
||||||
source = source,
|
source = source,
|
||||||
flowing = flowing,
|
flowing = flowing,
|
||||||
itemname = itemname:sub(1,1) == ":" and itemname:sub(2) or itemname,
|
itemname = itemname,
|
||||||
force_renew = force_renew,
|
force_renew = force_renew,
|
||||||
}
|
}
|
||||||
bucket.liquids[flowing] = bucket.liquids[source]
|
bucket.liquids[flowing] = bucket.liquids[source]
|
||||||
|
|
||||||
if itemname ~= nil then
|
if itemname ~= nil then
|
||||||
minetest.register_craftitem(itemname, {
|
minetest.register_craftitem(itemname_raw, {
|
||||||
description = name,
|
description = name,
|
||||||
inventory_image = inventory_image,
|
inventory_image = inventory_image,
|
||||||
stack_max = 1,
|
stack_max = 1,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue