Skip to content

Instantly share code, notes, and snippets.

@PilzAdam
Created May 6, 2013 23:06
Show Gist options
  • Save PilzAdam/5528992 to your computer and use it in GitHub Desktop.
Save PilzAdam/5528992 to your computer and use it in GitHub Desktop.
diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua
index d73a107..ca2f070 100644
--- a/mods/flowers/init.lua
+++ b/mods/flowers/init.lua
@@ -120,12 +120,32 @@ minetest.register_node("flowers:viola", {
},
})
+local flowers_abm = {}
+
+minetest.register_chatcommand("flower_debug", {
+ params = "<none>",
+ description = "Print flower debug",
+ privs = {server=true},
+ func = function(name, param)
+ for name,value in ipairs(flowers_abm) do
+ print(name..": "..value)
+ end
+ end,
+})
+
minetest.register_abm({
nodenames = {"group:flora"},
neighbors = {"default:dirt_with_grass", "default:desert_sand"},
interval = 50,
chance = 25,
action = function(pos, node)
+
+ if not flowers_abm[node.name] then
+ flowers_abm[node.name] = 1
+ else
+ flowers_abm[node.name] = flowers_abm[node.name] + 1
+ end
+
pos.y = pos.y - 1
local under = minetest.env:get_node(pos)
pos.y = pos.y + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment