summaryrefslogtreecommitdiff
path: root/pumpkin.lua
diff options
context:
space:
mode:
Diffstat (limited to 'pumpkin.lua')
-rw-r--r--pumpkin.lua176
1 files changed, 48 insertions, 128 deletions
diff --git a/pumpkin.lua b/pumpkin.lua
index 708d7ea..e443d66 100644
--- a/pumpkin.lua
+++ b/pumpkin.lua
@@ -1,6 +1,9 @@
---= Pumpkin (Big thanks to the PainterlyPack.net for Minecraft for allowing me to use these textures)
+--[[
+ Big thanks to PainterlyPack.net for allowing me to use these textures
+]]
+-- pumpkin
minetest.register_node("farming:pumpkin", {
description = "Pumpkin",
tiles = {
@@ -20,6 +23,7 @@ minetest.register_node("farming:pumpkin", {
sounds = default.node_sound_wood_defaults(),
})
+-- pumpkin slice
minetest.register_craftitem("farming:pumpkin_slice", {
description = "Pumpkin Slice",
inventory_image = "farming_pumpkin_slice.png",
@@ -45,7 +49,7 @@ minetest.register_craft({
}
})
--- Jack 'O Lantern
+-- jack 'o lantern
minetest.register_node("farming:jackolantern", {
description = "Jack 'O Lantern",
tiles = {
@@ -95,7 +99,7 @@ minetest.register_craft({
}
})
--- Pumpkin Bread
+-- pumpkin bread
minetest.register_craftitem("farming:pumpkin_bread", {
description = ("Pumpkin Bread"),
inventory_image = "farming_pumpkin_bread.png",
@@ -120,9 +124,8 @@ minetest.register_craft({
cooktime = 10
})
--- Define Pumpkin growth stages
-
-minetest.register_node("farming:pumpkin_1", {
+-- pumpkin definition
+local crop_def = {
drawtype = "plantlike",
tiles = {"farming_pumpkin_1.png"},
paramtype = "light",
@@ -136,125 +139,42 @@ minetest.register_node("farming:pumpkin_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:pumpkin_2", {
- drawtype = "plantlike",
- tiles = {"farming_pumpkin_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:pumpkin_3", {
- drawtype = "plantlike",
- tiles = {"farming_pumpkin_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:pumpkin_4", {
- drawtype = "plantlike",
- tiles = {"farming_pumpkin_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(),
-})
-
-minetest.register_node("farming:pumpkin_5", {
- drawtype = "plantlike",
- tiles = {"farming_pumpkin_5.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:pumpkin_6", {
- drawtype = "plantlike",
- tiles = {"farming_pumpkin_6.png"},
- paramtype = "light",
- 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:pumpkin_7", {
- drawtype = "plantlike",
- tiles = {"farming_pumpkin_7.png"},
- paramtype = "light",
- 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 does not have growing group so abm never checks these
-
-minetest.register_node("farming:pumpkin_8", {
- drawtype = "plantlike",
- tiles = {"farming_pumpkin_8.png"},
- paramtype = "light",
- walkable = false,
- buildable_to = true,
- drop = {
- items = {
- {items = {'farming:pumpkin_slice 9'}, rarity = 1},
- }
- },
- selection_box = farming.select,
- groups = {
- snappy = 3, flammable = 2, plant = 1, attached_node = 1,
- not_in_creative_inventory = 1
- },
- sounds = default.node_sound_defaults(),
-}) \ No newline at end of file
+ sounds = default.node_sound_leaves_defaults()
+}
+
+-- stage 1
+minetest.register_node("farming:pumpkin_1", table.copy(crop_def))
+
+-- stage 2
+crop_def.tiles = {"farming_pumpkin_2.png"}
+minetest.register_node("farming:pumpkin_2", table.copy(crop_def))
+
+-- stage 3
+crop_def.tiles = {"farming_pumpkin_3.png"}
+minetest.register_node("farming:pumpkin_3", table.copy(crop_def))
+
+-- stage 4
+crop_def.tiles = {"farming_pumpkin_4.png"}
+minetest.register_node("farming:pumpkin_4", table.copy(crop_def))
+
+-- stage 5
+crop_def.tiles = {"farming_pumpkin_5.png"}
+minetest.register_node("farming:pumpkin_5", table.copy(crop_def))
+
+-- stage 6
+crop_def.tiles = {"farming_pumpkin_6.png"}
+minetest.register_node("farming:pumpkin_6", table.copy(crop_def))
+
+-- stage 7
+crop_def.tiles = {"farming_pumpkin_7.png"}
+minetest.register_node("farming:pumpkin_7", table.copy(crop_def))
+
+-- stage 8 (final)
+crop_def.tiles = {"farming_pumpkin_8.png"}
+crop_def.groups.growing = 0
+crop_def.drop = {
+ items = {
+ {items = {'farming:pumpkin_slice 9'}, rarity = 1},
+ }
+}
+minetest.register_node("farming:pumpkin_8", table.copy(crop_def))