summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2015-04-10 14:46:28 -0700
committerAuke Kok <auke-jan.h.kok@intel.com>2015-04-10 14:46:28 -0700
commit5da6b39eeb42124e81b07e11014542d1bdb325a9 (patch)
tree28a7d06c5f105499aa8f631f04058c49d7fdb833
parentaa0dc0aa27c8fcc3f39b9d412a946913731979f8 (diff)
parameterize these for easy testing.
-rw-r--r--melon.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/melon.lua b/melon.lua
index e0877db..214a1fa 100644
--- a/melon.lua
+++ b/melon.lua
@@ -17,6 +17,9 @@ local faces = {
[4] = { x = 0, z = 1, r = 0, o = 2 }
}
+local interval = 30
+local chance = 10
+
minetest.register_node("crops:melon_seed", {
description = "melon seed",
inventory_image = "crops_melon_seed.png",
@@ -132,8 +135,8 @@ minetest.register_node("crops:melon", {
--
minetest.register_abm({
nodenames = { "crops:melon_plant_1", "crops:melon_plant_2", "crops:melon_plant_3","crops:melon_plant_4" },
- interval = 30,
- chance = 10,
+ interval = interval,
+ chance = chance,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.get_node_light(pos, nil) < 13 then
return
@@ -151,8 +154,8 @@ minetest.register_abm({
--
minetest.register_abm({
nodenames = { "crops:melon_plant_5" },
- interval = 30,
- chance = 10,
+ interval = interval,
+ chance = chance,
action = function(pos, node, active_object_count, active_object_count_wider)
if minetest.get_node_light(pos, nil) < 13 then
return
@@ -189,7 +192,7 @@ minetest.register_abm({
--
minetest.register_abm({
nodenames = { "crops:melon_plant_5_attached" },
- interval = 30,
+ interval = interval,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
for face = 1, 4 do