Created
May 6, 2013 23:06
-
-
Save PilzAdam/5528992 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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