From 4c412d97df012b56d7a1ce98f1efb4532ac109f5 Mon Sep 17 00:00:00 2001 From: unknown <24964441+wsor4035@users.noreply.github.com> Date: Tue, 23 Aug 2022 22:01:49 -0400 Subject: [PATCH] add new particles on 5.6 and above --- textures/abritorch_spark.png | Bin 0 -> 82 bytes torches.lua | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 textures/abritorch_spark.png diff --git a/textures/abritorch_spark.png b/textures/abritorch_spark.png new file mode 100644 index 0000000000000000000000000000000000000000..29c10206fe190c4a385cf946bdf80e780c7c2f31 GIT binary patch literal 82 zcmeAS@N?(olHy`uVBq!ia0vp^EFjFm1SHiab7}%9NlzEY5RU7~fBx5-GV>T1Dlm#^ e?9DUX#ltX9m4zq&bM*tDA_h-aKbLh*2~7ZJOA>wn literal 0 HcmV?d00001 diff --git a/torches.lua b/torches.lua index e38fc21..fd4ce5e 100644 --- a/torches.lua +++ b/torches.lua @@ -61,7 +61,7 @@ for i in ipairs(colour_list) do sunlight_propagates = true, walkable = false, light_source = 13, - groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1}, + groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1, abritorch=1}, drop = "abritorch:torch_"..colour, selection_box = { type = "wallmounted", @@ -87,7 +87,7 @@ for i in ipairs(colour_list) do sunlight_propagates = true, walkable = false, light_source = 13, - groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1}, + groups = {choppy=2, dig_immediate=3, flammable=1, not_in_creative_inventory=1, attached_node=1, torch=1, abritorch=1}, drop = "abritorch:torch_"..colour, selection_box = { type = "wallmounted", @@ -119,3 +119,32 @@ for i in ipairs(colour_list) do }) end +if minetest.features.particlespawner_tweenable then + minetest.register_abm({ + nodenames = { "group:abritorch" }, + interval = 1, + chance = 1, + catch_up = false, + action = function(pos, node) + local color = node.name:split(":")[2]:split("_")[2] + if color=="frosted" then + color = "white" + end + minetest.add_particlespawner({ + pos = { min = vector.add(pos, vector.new(-0.1, 0.45, -0.1)), max = vector.add(pos, vector.new(0.1, 0.5, 0.1)) }, + vel = { min = vector.new(0, 0, 0), max = vector.new( 0, 0.15, 0) }, + acc = { min = vector.new(0, 0.1, 0), max = vector.new(0, 0.3, 0) }, + time = 1, + amount = 2, + exptime = 1, + collisiondetection = true, + collision_removal = true, + glow = 14, + texpool = { + { name = "abritorch_spark.png", alpha_tween = { 1, 0 }, scale = 0.3 }, + { name = "abritorch_spark.png^[multiply:" .. color, alpha_tween = { 1, 0 }, scale = 0.5 }, + } + }) + end + }) +end \ No newline at end of file