From 0e462ef883c4107c0f467736c89f2c762063628e Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 6 Aug 2020 17:30:28 -0400 Subject: [PATCH] Update potions to not break on contact with liquid nodes. --- mods/ITEMS/mcl_potions/lingering.lua | 3 ++- mods/ITEMS/mcl_potions/splash.lua | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_potions/lingering.lua b/mods/ITEMS/mcl_potions/lingering.lua index f6c0bd4748..a12f8b304b 100644 --- a/mods/ITEMS/mcl_potions/lingering.lua +++ b/mods/ITEMS/mcl_potions/lingering.lua @@ -132,8 +132,9 @@ function mcl_potions.register_lingering(name, descr, color, def) local pos = self.object:get_pos() local node = minetest.get_node(pos) local n = node.name + local g = minetest.get_node_group(n, "liquid") local d = 4 - if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" or mcl_potions.is_obj_hit(self, pos) then + if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) add_lingering_effect(pos, color, def, name == "water") local texture, minacc, maxacc diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index 75ab6d6edb..54b321b444 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -61,9 +61,10 @@ function mcl_potions.register_splash(name, descr, color, def) local pos = self.object:get_pos() local node = minetest.get_node(pos) local n = node.name + local g = minetest.get_node_group(n, "liquid") local d = 0.1 local redux_map = {7/8,0.5,0.25} - if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" or mcl_potions.is_obj_hit(self, pos) then + if n ~= "air" and n ~= "mcl_portals:portal" and n ~= "mcl_portals:portal_end" and g == 0 or mcl_potions.is_obj_hit(self, pos) then minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1}) local texture, acc if name == "water" then