From 619ac5269393534c3f8ad8229514b17aa47eb513 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Mon, 8 Aug 2016 10:56:13 +0100 Subject: [PATCH] Add labels to ABMs Useful for searches and the mod profiler. --- mods/default/functions.lua | 7 +++++++ mods/farming/nodes.lua | 1 + mods/fire/init.lua | 4 ++++ mods/flowers/init.lua | 2 ++ mods/stairs/init.lua | 1 + mods/tnt/init.lua | 1 + 6 files changed, 16 insertions(+) diff --git a/mods/default/functions.lua b/mods/default/functions.lua index a98d091f..07f358cb 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -111,6 +111,7 @@ default.cool_lava = function(pos, node) end minetest.register_abm({ + label = "Lava cooling", nodenames = {"default:lava_source", "default:lava_flowing"}, neighbors = {"group:water"}, interval = 1, @@ -189,6 +190,7 @@ function default.grow_papyrus(pos, node) end minetest.register_abm({ + label = "Grow cactus", nodenames = {"default:cactus"}, neighbors = {"group:sand"}, interval = 12, @@ -199,6 +201,7 @@ minetest.register_abm({ }) minetest.register_abm({ + label = "Grow papyrus", nodenames = {"default:papyrus"}, neighbors = {"default:dirt", "default:dirt_with_grass"}, interval = 14, @@ -303,6 +306,7 @@ default.after_place_leaves = function(pos, placer, itemstack, pointed_thing) end minetest.register_abm({ + label = "Leaf decay", nodenames = {"group:leafdecay"}, neighbors = {"air", "group:liquid"}, -- A low interval and a high inverse chance spreads the load @@ -384,6 +388,7 @@ minetest.register_abm({ -- minetest.register_abm({ + label = "Grass spread", nodenames = {"default:dirt"}, neighbors = { "default:dirt_with_grass", @@ -440,6 +445,7 @@ minetest.register_abm({ -- minetest.register_abm({ + label = "Grass covered", nodenames = { "default:dirt_with_grass", "default:dirt_with_dry_grass", @@ -466,6 +472,7 @@ minetest.register_abm({ -- minetest.register_abm({ + label = "Moss growth", nodenames = {"default:cobble", "stairs:slab_cobble", "stairs:stair_cobble"}, neighbors = {"group:water"}, interval = 16, diff --git a/mods/farming/nodes.lua b/mods/farming/nodes.lua index c011df1e..9fa66c30 100644 --- a/mods/farming/nodes.lua +++ b/mods/farming/nodes.lua @@ -94,6 +94,7 @@ minetest.register_node("farming:straw", { }) minetest.register_abm({ + label = "Farming soil", nodenames = {"group:field"}, interval = 15, chance = 4, diff --git a/mods/fire/init.lua b/mods/fire/init.lua index 34613da5..3e04264e 100644 --- a/mods/fire/init.lua +++ b/mods/fire/init.lua @@ -221,6 +221,7 @@ end -- Extinguish all flames quickly with water, snow, ice minetest.register_abm({ + label = "Extinguish flame", nodenames = {"fire:basic_flame", "fire:permanent_flame"}, neighbors = {"group:puts_out_fire"}, interval = 3, @@ -241,6 +242,7 @@ if minetest.setting_getbool("disable_fire") then -- Remove basic flames only minetest.register_abm({ + label = "Remove disabled fire", nodenames = {"fire:basic_flame"}, interval = 7, chance = 1, @@ -253,6 +255,7 @@ else -- Ignite neighboring nodes, add basic flames minetest.register_abm({ + label = "Ignite flame", nodenames = {"group:flammable"}, neighbors = {"group:igniter"}, interval = 7, @@ -273,6 +276,7 @@ else -- Remove flammable nodes minetest.register_abm({ + label = "Remove flammable nodes", nodenames = {"fire:basic_flame"}, neighbors = "group:flammable", interval = 5, diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua index 83a05fad..8cf7ade2 100644 --- a/mods/flowers/init.lua +++ b/mods/flowers/init.lua @@ -110,6 +110,7 @@ function flowers.flower_spread(pos, node) end minetest.register_abm({ + label = "Flower spread", nodenames = {"group:flora"}, neighbors = {"default:dirt_with_grass", "default:dirt_with_dry_grass", "default:desert_sand"}, @@ -167,6 +168,7 @@ minetest.register_node("flowers:mushroom_brown", { -- Mushroom spread and death minetest.register_abm({ + label = "Mushroom spread", nodenames = {"flowers:mushroom_brown", "flowers:mushroom_red"}, interval = 11, chance = 50, diff --git a/mods/stairs/init.lua b/mods/stairs/init.lua index faaa92b3..001640fa 100644 --- a/mods/stairs/init.lua +++ b/mods/stairs/init.lua @@ -236,6 +236,7 @@ end if replace then minetest.register_abm({ + label = "Slab replace", nodenames = {"group:slabs_replace"}, interval = 16, chance = 1, diff --git a/mods/tnt/init.lua b/mods/tnt/init.lua index 3a397a78..1e6e29d5 100644 --- a/mods/tnt/init.lua +++ b/mods/tnt/init.lua @@ -506,6 +506,7 @@ if enable_tnt then }) minetest.register_abm({ + label = "TNT ignition", nodenames = {"group:tnt", "tnt:gunpowder"}, neighbors = {"fire:basic_flame", "default:lava_source", "default:lava_flowing"}, interval = 4, -- 2.25.1