From 51509658c4930e2cc3c721cd2ff84c2a4350ef44 Mon Sep 17 00:00:00 2001 From: wsor4035 <24964441+wsor4035@users.noreply.github.com> Date: Mon, 22 Aug 2022 23:56:30 -0400 Subject: [PATCH] 8 22 2022 features (#2) * add new particle features in 5.6 and above * get rid of nonsensical duplicate tool and merge functionality * replace version check with much more sane features check * remove now useless recipe * remove pointless default dep --- license.txt | 8 +++++- mod.conf | 2 +- nodes.lua | 59 ++++++++++++++++++++++++++------------- textures/flame_spark.png | Bin 0 -> 443 bytes 4 files changed, 48 insertions(+), 21 deletions(-) create mode 100644 textures/flame_spark.png diff --git a/license.txt b/license.txt index 858557a..6e55e1e 100644 --- a/license.txt +++ b/license.txt @@ -4,9 +4,15 @@ Original textures from Semmett9's fake_fire, now found in the homedecor modpack with adjustments and recolouring by Shara RedCat. License: CC-BY-SA 3.0 or higher (https://creativecommons.org/licenses/by/3.0/). +flame_spark.png x2048 +License: CC0 (https://creativecommons.org/publicdomain/zero/1.0/) + Code: License: MIT (https://opensource.org/licenses/MIT) -By Shara RedCat and tenplus1 +Shara RedCat +tenplus1 +wsor +x2048 diff --git a/mod.conf b/mod.conf index ad27d9c..1aea9a3 100644 --- a/mod.conf +++ b/mod.conf @@ -1,3 +1,3 @@ name = abriflame -depends = default, fire, abriglass +depends = fire, abriglass description = Adds coloured fire through use of fire starter tool. \ No newline at end of file diff --git a/nodes.lua b/nodes.lua index 9e0006c..7937d19 100644 --- a/nodes.lua +++ b/nodes.lua @@ -57,9 +57,9 @@ for _, f in pairs(flame_types) do inventory_image = f .. "_fire_inv.png", wield_image = f .. "_fire_inv.png", description = f .. " fire", - drawtype = "plantlike", + drawtype = "firelike", paramtype = "light", - groups = {dig_immediate = 3, not_in_creative_inventory = 1}, + groups = {dig_immediate = 3, not_in_creative_inventory = 1, abriflame_fire = 1}, sunlight_propagates = true, buildable_to = true, walkable = false, @@ -91,14 +91,44 @@ for _, f in pairs(flame_types) do }) end +if minetest.features.particlespawner_tweenable then + minetest.register_abm({ + nodenames = { "group:abriflame_fire" }, + interval = 1, + chance = 1, + catch_up = false, + action = function(pos, node) + local color = node.name:split(":")[2]:split("_")[1] + if color=="frosted" then + color = "white" + end + minetest.add_particlespawner({ + pos = { min = vector.add(pos, vector.new(-0.5, -0.5, -0.5)), max = vector.add(pos, vector.new(0.5, 0.5, 0.5)) }, + vel = { min = vector.new(-0.5, 0.5, -0.5), max = vector.new( 0.5, 0.5, 0.5) }, + acc = vector.new(0, 0.1, 0), + time = 1, + amount = 100, + exptime = 1, + collisiondetection = true, + collision_removal = true, + glow = 14, + texpool = { + { name = "flame_spark.png^[multiply:"..color, alpha_tween = { 1, 0 }, scale_tween = { 0.5, 0 }, blend = "screen" }, + { name = "flame_spark.png^[multiply:#c00", alpha_tween = { 1, 0 }, scale_tween = { 0.5, 0 }, blend = "screen" }, + { name = "flame_spark.png^[multiply:#800", alpha_tween = { 1, 0 }, scale_tween = { 0.5, 0 }, blend = "screen" }, + { name = "flame_spark.png^[multiply:#ff0", alpha_tween = { 1, 0 }, scale_tween = { 0.5, 0 }, blend = "screen" }, + { name = "flame_spark.png^[multiply:#fc0", alpha_tween = { 1, 0 }, scale_tween = { 0.5, 0 }, blend = "screen" }, + { name = "flame_spark.png^[multiply:#cc0", alpha_tween = { 1, 0 }, scale_tween = { 0.5, 0 }, blend = "screen" }, + { name = "flame_spark.png^[multiply:#f80", alpha_tween = { 1, 0 }, scale_tween = { 0.5, 0 }, blend = "screen" }, + } + }) + end + }) +end +local old_on_use = minetest.registered_items["fire:flint_and_steel"].on_use -- fire starter tool -minetest.register_tool("abriflame:flint", { - description = "Fire Starter", - inventory_image = "fire_flint_steel.png", - stack_max = 1, - liquids_pointable = false, - +minetest.override_item("fire:flint_and_steel", { on_use = function(itemstack, user, pointed_thing) if pointed_thing.type ~= "node" then return itemstack @@ -124,16 +154,7 @@ minetest.register_tool("abriflame:flint", { minetest.set_node(pos, {name = "abriflame:" .. namesplit[3] .. "_fire"}) end - itemstack:add_wear(65535 / 65) - return itemstack + return old_on_use(itemstack, user, pointed_thing) end, }) - - --- fire starter tool recipe -minetest.register_craft({ - output = "abriflame:flint", - recipe = { - {"default:mese_crystal_fragment", "default:steel_ingot"} - } -}) +minetest.register_alias("abriflame:flint", "fire:flint_and_steel") \ No newline at end of file diff --git a/textures/flame_spark.png b/textures/flame_spark.png new file mode 100644 index 0000000000000000000000000000000000000000..0c9c50f57ee210c21bb06d6e23c7be4754b06871 GIT binary patch literal 443 zcmV;s0Yv_ZP)$D z*^cBe2rS2tF_9eg|9|AJlx&POl*jv!p58;v69|f{3V3HZ=Vi%nQ|a&EW#4P9b+3EbOho{YJdR@mBzw0Y&p0IK zEUIQEDrQ#qT5DBR0PYS<21i7(@?7aYQA8w*s;a1Mw$~a#Ot`zK0!c+hHRmiyGfkv~ z`=1jNGl?kX^Lr{;^yXv&Nf-=9#0WAXNP2HSeog=}$Y78`MvxI>P{tTRlArEgtm&!% zdh>}yhP!+3-kfB_0FVJ-PSrIp%T4>&_zLp6eqGnqu6CZsbzRqWxi^vmp!e?X6LSJV z7Avc)@mw&D^X%Tcd++^^mX>9CJRW9dW+I}hH(BoP-M#sFo^QlgO4)1^6;%P!J)yOB l_kII-X