Update potions to not break on contact with liquid nodes.

This commit is contained in:
Brandon 2020-08-06 17:30:28 -04:00
parent 49a5f765bd
commit 0e462ef883
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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