From 1d471c52df7a34dac9f141cf173b16619a5d25b9 Mon Sep 17 00:00:00 2001 From: Brandon Date: Sun, 28 Jun 2020 12:16:07 -0400 Subject: [PATCH] Remove potion effects by drinking milk. --- mods/HUD/mcl_inventory/creative.lua | 2 +- mods/ITEMS/mcl_mobitems/init.lua | 2 +- mods/ITEMS/mcl_potions/functions.lua | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mods/HUD/mcl_inventory/creative.lua b/mods/HUD/mcl_inventory/creative.lua index 8fe745804..1c339cb96 100644 --- a/mods/HUD/mcl_inventory/creative.lua +++ b/mods/HUD/mcl_inventory/creative.lua @@ -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", } diff --git a/mods/ITEMS/mcl_mobitems/init.lua b/mods/ITEMS/mcl_mobitems/init.lua index 3e6aef485..1f8a13ff6 100644 --- a/mods/ITEMS/mcl_mobitems/init.lua +++ b/mods/ITEMS/mcl_mobitems/init.lua @@ -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",}}, }) - diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index 89ff1b531..aec3a8404 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -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)