Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add labels to ABMs
Useful for searches and the mod profiler.
  • Loading branch information
tenplus1 authored and paramat committed Aug 9, 2016
1 parent 61a197f commit 619ac52
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mods/default/functions.lua
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -384,6 +388,7 @@ minetest.register_abm({
--

minetest.register_abm({
label = "Grass spread",
nodenames = {"default:dirt"},
neighbors = {
"default:dirt_with_grass",
Expand Down Expand Up @@ -440,6 +445,7 @@ minetest.register_abm({
--

minetest.register_abm({
label = "Grass covered",
nodenames = {
"default:dirt_with_grass",
"default:dirt_with_dry_grass",
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions mods/farming/nodes.lua
Expand Up @@ -94,6 +94,7 @@ minetest.register_node("farming:straw", {
})

minetest.register_abm({
label = "Farming soil",
nodenames = {"group:field"},
interval = 15,
chance = 4,
Expand Down
4 changes: 4 additions & 0 deletions mods/fire/init.lua
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -273,6 +276,7 @@ else
-- Remove flammable nodes

minetest.register_abm({
label = "Remove flammable nodes",
nodenames = {"fire:basic_flame"},
neighbors = "group:flammable",
interval = 5,
Expand Down
2 changes: 2 additions & 0 deletions mods/flowers/init.lua
Expand Up @@ -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"},
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions mods/stairs/init.lua
Expand Up @@ -236,6 +236,7 @@ end

if replace then
minetest.register_abm({
label = "Slab replace",
nodenames = {"group:slabs_replace"},
interval = 16,
chance = 1,
Expand Down
1 change: 1 addition & 0 deletions mods/tnt/init.lua
Expand Up @@ -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,
Expand Down

0 comments on commit 619ac52

Please sign in to comment.