summaryrefslogtreecommitdiff
path: root/coffee.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 /coffee.lua
parenta91b9807974440c5a6487a4446ada29e382d7061 (diff)
Added barley, tidied and tweaked code
Diffstat (limited to 'coffee.lua')
-rw-r--r--coffee.lua143
1 files changed, 37 insertions, 106 deletions
diff --git a/coffee.lua b/coffee.lua
index 19c3f7f..c9854e6 100644
--- a/coffee.lua
+++ b/coffee.lua
@@ -1,6 +1,5 @@
---= Coffee
-
+-- coffee
minetest.register_craftitem("farming:coffee_beans", {
description = "Coffee Beans",
inventory_image = "farming_coffee_beans.png",
@@ -9,12 +8,8 @@ minetest.register_craftitem("farming:coffee_beans", {
end,
})
---= Glass Cup
---minetest.register_craftitem("farming:drinking_cup", {
--- description = "Drinking Cup",
--- inventory_image = "vessels_drinking_cup.png",
---})
+-- drinking cup
minetest.register_node("farming:drinking_cup", {
description = "Drinking Cup (empty)",
drawtype = "plantlike",
@@ -39,15 +34,9 @@ minetest.register_craft( {
}
})
---= Cold Cup of Coffee
---minetest.register_craftitem("farming:coffee_cup", {
--- description = "Cold Cup of Coffee",
--- inventory_image = "farming_coffee_cup.png",
--- on_use = minetest.item_eat(2, "farming:drinking_cup"),
---})
-
+-- cold cup of coffee
minetest.register_node("farming:coffee_cup", {
- description = "Cup of Coffee (cold)",
+ description = "Cold Cup of Coffee",
drawtype = "plantlike",
tiles = {"farming_coffee_cup.png"},
inventory_image = "farming_coffee_cup.png",
@@ -67,8 +56,6 @@ minetest.register_craft( {
output = "farming:coffee_cup",
recipe = {
{"farming:drinking_cup", "farming:coffee_beans","bucket:bucket_water"},
- {"","",""},
- {"","",""}
},
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}
})
@@ -80,15 +67,9 @@ minetest.register_craft({
recipe = "farming:coffee_cup"
})
---= Hot Cup of Coffee
---minetest.register_craftitem("farming:coffee_cup_hot", {
--- description = "Hot Cup of Coffee",
--- inventory_image = "farming_coffee_cup_hot.png",
--- on_use = minetest.item_eat(3, "farming:drinking_cup"),
---})
-
+-- hot cup of coffee
minetest.register_node("farming:coffee_cup_hot", {
- description = "Cup of Coffee (hot)",
+ description = "Hot Cup of Coffee",
drawtype = "plantlike",
tiles = {"farming_coffee_cup_hot.png"},
inventory_image = "farming_coffee_cup_hot.png",
@@ -104,9 +85,8 @@ minetest.register_node("farming:coffee_cup_hot", {
sounds = default.node_sound_glass_defaults(),
})
--- Define Coffee growth stages
-
-minetest.register_node("farming:coffee_1", {
+-- coffee definition
+local crop_def = {
drawtype = "plantlike",
tiles = {"farming_coffee_1.png"},
paramtype = "light",
@@ -119,81 +99,32 @@ minetest.register_node("farming:coffee_1", {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
- sounds = default.node_sound_leaves_defaults(),
-})
-
-minetest.register_node("farming:coffee_2", {
- drawtype = "plantlike",
- tiles = {"farming_coffee_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(),
-})
-
-minetest.register_node("farming:coffee_3", {
- drawtype = "plantlike",
- tiles = {"farming_coffee_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(),
-})
-
-minetest.register_node("farming:coffee_4", {
- drawtype = "plantlike",
- tiles = {"farming_coffee_4.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(),
-})
-
--- Last stage of growth doesn not have growing group so abm never checks these
-
-minetest.register_node("farming:coffee_5", {
- drawtype = "plantlike",
- tiles = {"farming_coffee_5.png"},
- paramtype = "light",
- sunlight_propagates = true,
- waving = 1,
- walkable = false,
- buildable_to = true,
- drop = {
- items = {
- {items = {'farming:coffee_beans 2'}, rarity = 1},
- {items = {'farming:coffee_beans 2'}, rarity = 2},
- {items = {'farming:coffee_beans 2'}, 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
+ sounds = default.node_sound_leaves_defaults()
+}
+
+-- stage 1
+minetest.register_node("farming:coffee_1", table.copy(crop_def))
+
+-- stage 2
+crop_def.tiles = {"farming_coffee_2.png"}
+minetest.register_node("farming:coffee_2", table.copy(crop_def))
+
+-- stage 3
+crop_def.tiles = {"farming_coffee_3.png"}
+minetest.register_node("farming:coffee_3", table.copy(crop_def))
+
+-- stage 4
+crop_def.tiles = {"farming_coffee_4.png"}
+minetest.register_node("farming:coffee_4", table.copy(crop_def))
+
+-- stage 5 (final)
+crop_def.tiles = {"farming_coffee_5.png"}
+crop_def.groups.growing = 0
+crop_def.drop = {
+ items = {
+ {items = {'farming:coffee_beans 2'}, rarity = 1},
+ {items = {'farming:coffee_beans 2'}, rarity = 2},
+ {items = {'farming:coffee_beans 2'}, rarity = 3},
+ }
+}
+minetest.register_node("farming:coffee_5", table.copy(crop_def))