diff --git a/mob_meta.lua b/mob_meta.lua index c458508..9cd537e 100644 --- a/mob_meta.lua +++ b/mob_meta.lua @@ -2,6 +2,13 @@ -- Mob Meta -- -------------- +-- Visual Harm 1ndicator check + +local use_vh1 +minetest.register_on_mods_loaded(function() + use_vh1 = minetest.get_modpath("visual_harm_1ndicators") +end) + -- Math -- local pi = math.pi @@ -239,6 +246,9 @@ function mob:hurt(health) if self.protected then return end self.hp = self.hp - math.ceil(health) if self.hp < 0 then self.hp = 0 end + if use_vh1 then + VH1.update_bar(self.object, self.hp, self.max_health) + end end -- Add HP to mob @@ -249,6 +259,9 @@ function mob:heal(health) if self.hp > self.max_health then self.hp = self.max_health end + if use_vh1 then + VH1.update_bar(self.object, self.hp, self.max_health) + end end -- Return position at center of mobs hitbox diff --git a/mod.conf b/mod.conf index e126b90..330a208 100644 --- a/mod.conf +++ b/mod.conf @@ -1,2 +1,6 @@ name = creatura -description = A performant, semi-modular mob API \ No newline at end of file +description = A performant, semi-modular mob API +optional_depends = visual_harm_1ndicators +release = 17555 +author = ElCeejo +title = Creatura