Remove potion effects by drinking milk.

This commit is contained in:
Brandon 2020-06-28 12:16:07 -04:00
parent 44ee9cde86
commit 1d471c52df
3 changed files with 5 additions and 6 deletions

View File

@ -374,7 +374,7 @@ mcl_inventory.set_creative_formspec = function(player, start_i, pagenum, inv_siz
tools = "mcl_core:axe_iron",
combat = "mcl_core:sword_gold",
mobs = "mobs_mc:cow",
brew = "mcl_potions:water",
brew = "mcl_potions:dragon_breath",
matr = "mcl_core:stick",
inv = "mcl_chests:chest",
}

View File

@ -142,6 +142,7 @@ local drink_milk = function(itemstack, player, pointed_thing)
if mcl_hunger.active and (bucket:get_name() ~= "mcl_mobitems:milk_bucket" or minetest.settings:get_bool("creative_mode") == true) then
mcl_hunger.stop_poison(player)
end
mcl_potions._reset_player_effects(player)
return bucket
end
@ -439,4 +440,3 @@ minetest.register_craft({
{"mcl_mobitems:slimeball","mcl_mobitems:slimeball","mcl_mobitems:slimeball",},
{"mcl_mobitems:slimeball","mcl_mobitems:slimeball","mcl_mobitems:slimeball",}},
})

View File

@ -187,7 +187,7 @@ minetest.register_globalstep(function(dtime)
end)
local function _reset_player_effects(player)
function mcl_potions._reset_player_effects(player)
player = player or player:get_luaentity()
@ -231,9 +231,8 @@ local function _reset_player_effects(player)
end
minetest.register_on_leaveplayer( function(player) _reset_player_effects(player) end)
minetest.register_on_dieplayer( function(player) _reset_player_effects(player) end)
minetest.register_on_leaveplayer( function(player) mcl_potions._reset_player_effects(player) end)
minetest.register_on_dieplayer( function(player) mcl_potions._reset_player_effects(player) end)
function mcl_potions.is_obj_hit(self, pos)