]> git.lizzy.rs Git - Crafter.git/commitdiff
Add in custom mob api explosion blink colors
authoroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 19 May 2020 15:45:46 +0000 (11:45 -0400)
committeroilboi <47129783+oilboi@users.noreply.github.com>
Tue, 19 May 2020 15:45:46 +0000 (11:45 -0400)
mods/mob/api/api_hook.lua
mods/mob/api/timers.lua

index 2ceaef7ac192e371e908e74bf41e184432850fd4..533dacf7b57a2c07ef2ba0fc76cfdbe39f0acc67 100644 (file)
@@ -86,6 +86,7 @@ mob_register.explosion_radius = def.explosion_radius
 mob_register.explosion_power = def.explosion_power
 mob_register.tnt_timer = nil
 mob_register.explosion_time = def.explosion_time
+mob_register.explosion_blink_color = def.explosion_blink_color or "white"
 
 mob_register.custom_function_begin = def.custom_function_begin
 mob_register.custom_function_end = def.custom_function_end
index 5345ef7d57e3425e5f3676fa03e0ea54b81be9f7..eeb684f9c487c02cd48df37e0ee2f5e612902064 100644 (file)
@@ -44,7 +44,7 @@ mobs.create_timer_functions = function(def,mob_register)
                        if self.tnt_mod_state == 0 then
                                self.object:set_texture_mod("")
                        else
-                               self.object:set_texture_mod("^[colorize:white:130")
+                               self.object:set_texture_mod("^[colorize:"..self.explosion_blink_color..":130")
                        end
                        --print(self.object:get_texture_mod())
                        --self.object:set_texture_mod("^[colorize:red:130")