3 minetest
.register_craftitem("farming:pumpkin_seed", {
4 description
= "Pumpkin Seed",
6 inventory_image
= "farming_pumpkin_seed.png",
7 on_place
= function(itemstack
, placer
, pointed_thing
)
8 local above
= minetest
.env
:get_node(pointed_thing
.above
)
9 if above
.name
== "air" then
10 above
.name
= "farming:pumpkin_1"
11 minetest
.env
:set_node(pointed_thing
.above
, above
)
12 itemstack
:take_item(1)
18 minetest
.register_node("farming:pumpkin_1", {
21 drawtype
= "plantlike",
22 sunlight_propagates
= true,
24 tiles
= {"farming_tige_1.png"},
28 {-0.5, -0.5, -0.5, 0.5, -0.5+6/16, 0.5}
31 groups
= {snappy
=3, flammable
=2, not_in_creative_inventory
=1 ,dig_by_water
=1},
32 sounds
= default
.node_sound_leaves_defaults(),
35 minetest
.register_node("farming:pumpkin_2", {
38 drawtype
= "plantlike",
39 sunlight_propagates
= true,
41 tiles
= {"farming_tige_2.png"},
45 {-0.5, -0.5, -0.5, 0.5, -0.5+9/16, 0.5}
48 groups
= {snappy
=3, flammable
=2, not_in_creative_inventory
=1 ,dig_by_water
=1},
49 sounds
= default
.node_sound_leaves_defaults(),
53 minetest
.register_node("farming:pumpkin_face", {
54 description
= "Pumpkin Face",
56 paramtype2
= "facedir",
57 tiles
= {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face.png"},
58 groups
= {choppy
=2, oddly_breakable_by_hand
=2, flammable
=2},
59 after_dig_node
= function(pos
, oldnode
, oldmetadata
, user
)
62 local p
= {x
=pos
.x
+x
, y
=pos
.y
, z
=pos
.z
}
63 local n
= minetest
.env
:get_node(p
)
64 if string.find(n
.name
, "pumpkintige_linked_") and have_change
== 0 then
66 minetest
.env
:add_node(p
, {name
="farming:pumpkintige_unconnect"})
69 if have_change
== 0 then
71 p
= {x
=pos
.x
, y
=pos
.y
, z
=pos
.z
+z
}
72 local n
= minetest
.env
:get_node(p
)
73 if string.find(n
.name
, "pumpkintige_linked_") and have_change
== 0 then
75 minetest
.env
:add_node(p
, {name
="farming:pumpkintige_unconnect"})
82 minetest
.register_node("farming:pumpkintige_unconnect", {
85 sunlight_propagates
= true,
87 drawtype
= "plantlike",
88 tiles
= {"farming_tige_end.png"},
89 groups
= {snappy
=3, flammable
=2, not_in_creative_inventory
=1 ,dig_by_water
=1},
90 sounds
= default
.node_sound_leaves_defaults(),
94 minetest
.register_node("farming:pumpkintige_linked_r", {
96 sunlight_propagates
= true,
101 paramtype2
= "wallmounted",
102 legacy_wallmounted
= true,
106 {-0.5, -0.5, 0, 0.5, 0.5, 0}, -- NodeBox1
111 fixed
= {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
114 "farming_tige_connnect.png", --top
115 "farming_tige_connnect.png", -- bottom
116 "farming_tige_connnect.png", -- right
117 "farming_tige_connnect.png", -- left
118 "farming_tige_connnect.png", -- back
119 "farming_tige_connnect.png^[transformFX90" --front
121 groups
= {snappy
=3, flammable
=2, not_in_creative_inventory
=1 ,dig_by_water
=1},
122 sounds
= default
.node_sound_leaves_defaults(),
125 minetest
.register_node("farming:pumpkintige_linked_l", {
128 sunlight_propagates
= true,
130 drawtype
= "nodebox",
132 paramtype2
= "wallmounted",
133 legacy_wallmounted
= true,
137 {-0.5, -0.5, 0, 0.5, 0.5, 0}, -- NodeBox1
142 fixed
= {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
145 "farming_tige_connnect.png", --top
146 "farming_tige_connnect.png", -- bottom
147 "farming_tige_connnect.png", -- right
148 "farming_tige_connnect.png", -- left
149 "farming_tige_connnect.png^[transformFX90", -- back
150 "farming_tige_connnect.png" --front
152 groups
= {snappy
=3, flammable
=2, not_in_creative_inventory
=1 ,dig_by_water
=1},
153 sounds
= default
.node_sound_leaves_defaults(),
156 minetest
.register_node("farming:pumpkintige_linked_t", {
159 sunlight_propagates
= true,
161 drawtype
= "nodebox",
163 paramtype2
= "wallmounted",
164 legacy_wallmounted
= true,
168 {0, -0.5, -0.5, 0, 0.5, 0.5}, -- NodeBox1
173 fixed
= {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
176 "farming_tige_connnect.png", --top
177 "farming_tige_connnect.png", -- bottom
178 "farming_tige_connnect.png^[transformFX90", -- right
179 "farming_tige_connnect.png", -- left
180 "farming_tige_connnect.png", -- back
181 "farming_tige_connnect.png" --front
183 groups
= {snappy
=3, flammable
=2, not_in_creative_inventory
=1 ,dig_by_water
=1},
184 sounds
= default
.node_sound_leaves_defaults(),
187 minetest
.register_node("farming:pumpkintige_linked_b", {
190 sunlight_propagates
= true,
192 drawtype
= "nodebox",
194 paramtype2
= "wallmounted",
195 legacy_wallmounted
= true,
199 {0, -0.5, -0.5, 0, 0.5, 0.5}, -- NodeBox1
204 fixed
= {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
207 "farming_tige_connnect.png", --top
208 "farming_tige_connnect.png", -- bottom
209 "farming_tige_connnect.png", -- right
210 "farming_tige_connnect.png^[transformFX90", -- left
211 "farming_tige_connnect.png", -- back
212 "farming_tige_connnect.png" --front
214 groups
= {snappy
=3, flammable
=2, not_in_creative_inventory
=1 ,dig_by_water
=1},
215 sounds
= default
.node_sound_leaves_defaults(),
218 farming
:add_plant("farming:pumpkintige_unconnect", {"farming:pumpkin_1", "farming:pumpkin_2"}, 80, 20)
221 minetest
.register_abm({
222 nodenames
= {"farming:pumpkintige_unconnect"},
226 action
= function(pos
)
227 local have_change
= 0
228 local newpos
= {x
=pos
.x
, y
=pos
.y
, z
=pos
.z
}
229 local light
= minetest
.get_node_light(pos
)
230 if light
or light
> 10 then
232 local p
= {x
=pos
.x
+x
, y
=pos
.y
-1, z
=pos
.z
}
233 newpos
= {x
=pos
.x
+x
, y
=pos
.y
, z
=pos
.z
}
234 local n
= minetest
.env
:get_node(p
)
235 local nod
= minetest
.env
:get_node(newpos
)
236 if n
.name
=="default:dirt_with_grass" and nod
.name
=="air" and have_change
== 0
237 or n
.name
=="default:dirt" and nod
.name
=="air" and have_change
== 0
238 or string.find(n
.name
, "farming:soil") and nod
.name
=="air" and have_change
== 0 then
240 minetest
.env
:add_node(newpos
, {name
="farming:pumpkin_face"})
242 minetest
.env
:add_node(pos
, {name
="farming:pumpkintige_linked_r" })
244 minetest
.env
:add_node(pos
, {name
="farming:pumpkintige_linked_l"})
248 if have_change
== 0 then
250 p
= {x
=pos
.x
, y
=pos
.y
-1, z
=pos
.z
+z
}
251 newpos
= {x
=pos
.x
, y
=pos
.y
, z
=pos
.z
+z
}
252 n
= minetest
.env
:get_node(p
)
253 local nod2
= minetest
.env
:get_node(newpos
)
254 if n
.name
=="default:dirt_with_grass" and nod2
.name
=="air" and have_change
== 0
255 or n
.name
=="default:dirt" and nod2
.name
=="air" and have_change
== 0
256 or string.find(n
.name
, "farming:soil") and nod2
.name
=="air" and have_change
== 0 then
258 minetest
.env
:add_node(newpos
, {name
="farming:pumpkin_face"})
260 minetest
.env
:add_node(pos
, {name
="farming:pumpkintige_linked_t" })
262 minetest
.env
:add_node(pos
, {name
="farming:pumpkintige_linked_b" })
273 minetest
.register_node("farming:pumpkin_face_light", {
274 description
= "Jack O' Lantern",
276 paramtype2
= "facedir",
277 light_source
= LIGHT_MAX
,
278 tiles
= {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face_light.png"},
279 groups
= {choppy
=2, oddly_breakable_by_hand
=2, flammable
=2},
282 minetest
.register_craft({
284 output
= "farming:pumpkin_face_light",
285 recipe
= {"farming:pumpkin_face", "default:torch"}
288 minetest
.register_craft({
290 output
= "farming:pumpkin_seed 4",
291 recipe
= {"farming:pumpkin_face"}
295 -- ========= FUEL =========
296 minetest
.register_craft({
298 recipe
= "farming:pumpkin_seed",