From 3c8389809553b73f2df4828af8efa65e6343435f Mon Sep 17 00:00:00 2001 From: AFCMS Date: Thu, 18 Mar 2021 19:30:53 +0100 Subject: [PATCH] quick fix --- mods/ITEMS/mcl_cauldrons/init.lua | 14 +++++++------- mods/ITEMS/mcl_potions/init.lua | 30 +----------------------------- 2 files changed, 8 insertions(+), 36 deletions(-) diff --git a/mods/ITEMS/mcl_cauldrons/init.lua b/mods/ITEMS/mcl_cauldrons/init.lua index 8485471a8c..7c86561978 100644 --- a/mods/ITEMS/mcl_cauldrons/init.lua +++ b/mods/ITEMS/mcl_cauldrons/init.lua @@ -78,7 +78,7 @@ function mcl_cauldrons.get_cauldron_level(pos) end function mcl_cauldrons.is_cauldron(name) - return minetest.get_item_group(nn.name, "cauldron") ~= 0 + return minetest.get_item_group(name, "cauldron") ~= 0 end function mcl_cauldrons.take_cauldron(pos, itemstack, user, sounds) @@ -112,16 +112,16 @@ function mcl_cauldrons.take_small_cauldron(pos, itemstack, user, sounds) minetest.sound_play("mcl_potions_bottle_fill", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) if minetest.is_creative_enabled(placer:get_player_name()) then -- Don't replace empty bottle in creative for convenience reasons - if not inv:contains_item("main", water_bottle) then - inv:add_item("main", water_bottle) + if not inv:contains_item("main", item_name) then + inv:add_item("main", item_name) end elseif itemstack:get_count() == 1 then - return water_bottle + return item_name else - if inv:room_for_item("main", water_bottle) then - inv:add_item("main", water_bottle) + if inv:room_for_item("main", item_name) then + inv:add_item("main", item_name) else - minetest.add_item(placer:get_pos(), water_bottle) + minetest.add_item(placer:get_pos(), item_name) end itemstack:take_item() end diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index b41cd7c13f..ddc3e13b77 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -81,35 +81,7 @@ minetest.register_craftitem("mcl_potions:glass_bottle", { minetest.record_protection_violation(pointed_thing.under, pname) return itemstack end - local added = mcl_cauldrons.take_small_cauldron(pointed_thing.under, itemstack, placer, {dug = "mcl_potions_bottle_fill"}) - if added == itemstack then - end - if get_water then - local water_bottle - if river_water then - water_bottle = ItemStack("mcl_potions:river_water") - else - water_bottle = ItemStack("mcl_potions:water") - end - -- Replace with water bottle, if possible, otherwise - -- place the water potion at a place where's space - local inv = placer:get_inventory() - minetest.sound_play("mcl_potions_bottle_fill", {pos=pointed_thing.under, gain=0.5, max_hear_range=16}, true) - if minetest.is_creative_enabled(placer:get_player_name()) then - -- Don't replace empty bottle in creative for convenience reasons - if not inv:contains_item("main", water_bottle) then - inv:add_item("main", water_bottle) - end - elseif itemstack:get_count() == 1 then - return water_bottle - else - if inv:room_for_item("main", water_bottle) then - inv:add_item("main", water_bottle) - else - minetest.add_item(placer:get_pos(), water_bottle) - end - itemstack:take_item() - end + mcl_cauldrons.take_small_cauldron(pointed_thing.under, itemstack, placer, {dug = "mcl_potions_bottle_fill"}) end end return itemstack