summaryrefslogtreecommitdiff
path: root/blueberry.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-03-10 17:45:55 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2016-03-10 17:45:55 +0000
commitdaac92f3983afd8e1ff63c4043547d03519ef460 (patch)
tree4dd7ae04f10559a5a54cc93095db49922f3f28e0 /blueberry.lua
parenta91b9807974440c5a6487a4446ada29e382d7061 (diff)
Added barley, tidied and tweaked code
Diffstat (limited to 'blueberry.lua')
-rw-r--r--blueberry.lua88
1 files changed, 25 insertions, 63 deletions
diff --git a/blueberry.lua b/blueberry.lua
index f785c23..6a29ba9 100644
--- a/blueberry.lua
+++ b/blueberry.lua
@@ -1,6 +1,5 @@
---= Blueberries
-
+-- blueberries
minetest.register_craftitem("farming:blueberries", {
description = "Blueberries",
inventory_image = "farming_blueberries.png",
@@ -10,7 +9,7 @@ minetest.register_craftitem("farming:blueberries", {
on_use = minetest.item_eat(1),
})
--- Blueberry Muffin (Thanks to sosogirl123 for muffin image in deviantart.com)
+-- blueberry muffin (thanks to sosogirl123 @ deviantart.com for muffin image)
minetest.register_craftitem("farming:muffin_blueberry", {
description = "Blueberry Muffin",
@@ -25,9 +24,8 @@ minetest.register_craft({
}
})
--- Define Blueberry growth stages
-
-minetest.register_node("farming:blueberry_1", {
+-- blueberry definition
+local crop_def = {
drawtype = "plantlike",
tiles = {"farming_blueberry_1.png"},
paramtype = "light",
@@ -40,64 +38,28 @@ minetest.register_node("farming:blueberry_1", {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
- sounds = default.node_sound_leaves_defaults(),
-})
+ sounds = default.node_sound_leaves_defaults()
+}
-minetest.register_node("farming:blueberry_2", {
- drawtype = "plantlike",
- tiles = {"farming_blueberry_2.png"},
- paramtype = "light",
- sunlight_propagates = true,
- waving = 1,
- walkable = false,
- buildable_to = true,
- drop = "",
- selection_box = farming.select,
- groups = {
- snappy = 3, flammable = 2, plant = 1, attached_node = 1,
- not_in_creative_inventory = 1, growing = 1
- },
- sounds = default.node_sound_leaves_defaults(),
-})
+-- stage 1
+minetest.register_node("farming:blueberry_1", table.copy(crop_def))
-minetest.register_node("farming:blueberry_3", {
- drawtype = "plantlike",
- tiles = {"farming_blueberry_3.png"},
- paramtype = "light",
- sunlight_propagates = true,
- waving = 1,
- walkable = false,
- buildable_to = true,
- drop = "",
- selection_box = farming.select,
- groups = {
- snappy = 3, flammable = 2, plant = 1, attached_node = 1,
- not_in_creative_inventory = 1, growing = 1
- },
- sounds = default.node_sound_leaves_defaults(),
-})
+-- stage 2
+crop_def.tiles = {"farming_blueberry_2.png"}
+minetest.register_node("farming:blueberry_2", table.copy(crop_def))
--- Last stage of growth does not have growing group so abm never checks these
+-- stage 3
+crop_def.tiles = {"farming_blueberry_3.png"}
+minetest.register_node("farming:blueberry_3", table.copy(crop_def))
-minetest.register_node("farming:blueberry_4", {
- drawtype = "plantlike",
- tiles = {"farming_blueberry_4.png"},
- paramtype = "light",
- sunlight_propagates = true,
- waving = 1,
- walkable = false,
- buildable_to = true,
- drop = {
- items = {
- {items = {'farming:blueberries 2'}, rarity = 1},
- {items = {'farming:blueberries'}, rarity = 2},
- {items = {'farming:blueberries'}, rarity = 3},
- }
- },
- selection_box = farming.select,
- groups = {
- snappy = 3, flammable = 2, plant = 1, attached_node = 1,
- not_in_creative_inventory=1
- },
- sounds = default.node_sound_leaves_defaults(),
-}) \ No newline at end of file
+-- stage 4 (final)
+crop_def.tiles = {"farming_blueberry_4.png"}
+crop_def.groups.growing = 0
+crop_def.drop = {
+ items = {
+ {items = {'farming:blueberries 2'}, rarity = 1},
+ {items = {'farming:blueberries'}, rarity = 2},
+ {items = {'farming:blueberries'}, rarity = 3},
+ }
+}
+minetest.register_node("farming:blueberry_4", table.copy(crop_def))