make lingering potions activate target (+ indentation fix)

This commit is contained in:
AFCMS 2022-02-26 22:44:50 +01:00
parent eae8effd57
commit 210a0d8ee1
Signed by untrusted user: AFCMS
GPG Key ID: 8720389A25B652E3
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")