1
0
Fork 0

make lingering potions activate target (+ indentation fix)

This commit is contained in:
AFCMS 2022-02-26 22:44:50 +01:00 committed by cora
parent 1a1c592452
commit fb35af4dba
1 changed files with 66 additions and 61 deletions

View File

@ -1,5 +1,7 @@
local S = minetest.get_translator(minetest.get_current_modname())
local mod_target = minetest.get_modpath("mcl_target")
local function lingering_image(colorstring, opacity)
if not opacity then
opacity = 127
@ -141,6 +143,9 @@ minetest.register_entity(id.."_flying",{
local n = node.name
local g = minetest.get_item_group(n, "liquid")
local d = 4
if mod_target and n == "mcl_target:target_off" then
mcl_target.hit(vector.round(pos), 0.4) --4 redstone ticks
end
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")