From eb64ff94f82d726e4a55b20fa7ce30e4a7470cc5 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Tue, 2 Jun 2020 12:48:56 +0200 Subject: [PATCH] Use node particles for TNT explosions (#2695) --- mods/tnt/init.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mods/tnt/init.lua b/mods/tnt/init.lua index 1e2fb80..1e3f37e 100644 --- a/mods/tnt/init.lua +++ b/mods/tnt/init.lua @@ -238,12 +238,16 @@ local function add_effects(pos, radius, drops) -- we just dropped some items. Look at the items entities and pick -- one of them to use as texture local texture = "tnt_blast.png" --fallback texture + local node local most = 0 for name, stack in pairs(drops) do local count = stack:get_count() if count > most then most = count local def = minetest.registered_nodes[name] + if def then + node = { name = name } + end if def and def.tiles and def.tiles[1] then texture = def.tiles[1] end @@ -261,9 +265,11 @@ local function add_effects(pos, radius, drops) maxacc = {x = 0, y = -10, z = 0}, minexptime = 0.8, maxexptime = 2.0, - minsize = radius * 0.66, - maxsize = radius * 2, + minsize = radius * 0.33, + maxsize = radius, texture = texture, + -- ^ only as fallback for clients without support for `node` parameter + node = node, collisiondetection = true, }) end