summaryrefslogtreecommitdiff
path: root/raspberry.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 /raspberry.lua
parenta91b9807974440c5a6487a4446ada29e382d7061 (diff)
Added barley, tidied and tweaked code
Diffstat (limited to 'raspberry.lua')
-rw-r--r--raspberry.lua89
1 files changed, 25 insertions, 64 deletions
diff --git a/raspberry.lua b/raspberry.lua
index b202f60..51d10cc 100644
--- a/raspberry.lua
+++ b/raspberry.lua
@@ -1,6 +1,5 @@
---= Raspberries
-
+-- raspberries
minetest.register_craftitem("farming:raspberries", {
description = "Raspberries",
inventory_image = "farming_raspberries.png",
@@ -10,8 +9,7 @@ minetest.register_craftitem("farming:raspberries", {
on_use = minetest.item_eat(1),
})
--- Raspberry Smoothie
-
+-- raspberry smoothie
minetest.register_craftitem("farming:smoothie_raspberry", {
description = "Raspberry Smoothie",
inventory_image = "farming_raspberry_smoothie.png",
@@ -27,9 +25,8 @@ minetest.register_craft({
}
})
--- Define Raspberry growth stages
-
-minetest.register_node("farming:raspberry_1", {
+-- raspberries definition
+local crop_def = {
drawtype = "plantlike",
tiles = {"farming_raspberry_1.png"},
paramtype = "light",
@@ -42,64 +39,28 @@ minetest.register_node("farming:raspberry_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:raspberry_2", {
- drawtype = "plantlike",
- tiles = {"farming_raspberry_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:raspberry_1", table.copy(crop_def))
-minetest.register_node("farming:raspberry_3", {
- drawtype = "plantlike",
- tiles = {"farming_raspberry_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_raspberry_2.png"}
+minetest.register_node("farming:raspberry_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_raspberry_3.png"}
+minetest.register_node("farming:raspberry_3", table.copy(crop_def))
-minetest.register_node("farming:raspberry_4", {
- drawtype = "plantlike",
- tiles = {"farming_raspberry_4.png"},
- paramtype = "light",
- sunlight_propagates = true,
- waving = 1,
- walkable = false,
- buildable_to = true,
- drop = {
- items = {
- {items = {'farming:raspberries 2'}, rarity = 1},
- {items = {'farming:raspberries'}, rarity = 2},
- {items = {'farming:raspberries'}, 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_raspberry_4.png"}
+crop_def.groups.growing = 0
+crop_def.drop = {
+ items = {
+ {items = {'farming:raspberries 2'}, rarity = 1},
+ {items = {'farming:raspberries'}, rarity = 2},
+ {items = {'farming:raspberries'}, rarity = 3},
+ }
+}
+minetest.register_node("farming:raspberry_4", table.copy(crop_def))