Update potions to not break on contact with liquid nodes.
This commit is contained in:
parent
49a5f765bd
commit
0e462ef883
|
@ -132,8 +132,9 @@ function mcl_potions.register_lingering(name, descr, color, def)
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local n = node.name
|
local n = node.name
|
||||||
|
local g = minetest.get_node_group(n, "liquid")
|
||||||
local d = 4
|
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})
|
minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1})
|
||||||
add_lingering_effect(pos, color, def, name == "water")
|
add_lingering_effect(pos, color, def, name == "water")
|
||||||
local texture, minacc, maxacc
|
local texture, minacc, maxacc
|
||||||
|
|
|
@ -61,9 +61,10 @@ function mcl_potions.register_splash(name, descr, color, def)
|
||||||
local pos = self.object:get_pos()
|
local pos = self.object:get_pos()
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local n = node.name
|
local n = node.name
|
||||||
|
local g = minetest.get_node_group(n, "liquid")
|
||||||
local d = 0.1
|
local d = 0.1
|
||||||
local redux_map = {7/8,0.5,0.25}
|
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})
|
minetest.sound_play("mcl_potions_breaking_glass", {pos = pos, max_hear_distance = 16, gain = 1})
|
||||||
local texture, acc
|
local texture, acc
|
||||||
if name == "water" then
|
if name == "water" then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user