]> git.lizzy.rs Git - Crafter.git/blob - mods/farming/registers.lua
7146d0fda732852c30af356e2689c0685d90d560
[Crafter.git] / mods / farming / registers.lua
1 minetest.register_plant("cactus", {
2         description = "Cactus",
3         
4         tiles = {"cactus_top.png", "cactus_bottom.png", "cactus_side.png"},
5         
6         groups = {dig_immediate=1,flammable=1,touch_hurt=1},
7         
8         sounds = main.dirtSound(),
9         
10         paramtype = "light",
11         
12         sunlight_propagates = true,
13         
14         drawtype = "nodebox",
15         
16         buildable_to = false,
17         
18         waving            = 0,
19         --inventory_image   = def.inventory_image,
20         --walkable          = def.walkable,
21         --climbable         = def.climbable,
22         --paramtype2        = def.paramtype2,
23         --buildable_to      = def.buildable_to,
24         --selection_box     = def.selection_box,
25         --drop              = def.drop,
26         grows             = "up",
27         node_box = {
28                 type = "fixed",
29                 fixed = {
30                         {-7/16, -8/16, -7/16,  7/16, 8/16,  7/16}, -- Main body
31                         {-8/16, -8/16, -7/16,  8/16, 8/16, -7/16}, -- Spikes
32                         {-8/16, -8/16,  7/16,  8/16, 8/16,  7/16}, -- Spikes
33                         {-7/16, -8/16, -8/16, -7/16, 8/16,  8/16}, -- Spikes
34                         {7/16,  -8/16,  8/16,  7/16, 8/16, -8/16}, -- Spikes
35                 },
36         },
37 })
38
39 minetest.register_plant("sugarcane", {
40         description = "Sugarcane",
41         
42         inventory_image = "sugarcane.png",
43         
44         tiles = {"sugarcane.png"},
45         
46         groups = {dig_immediate=1,flammable=1},
47         
48         sounds = main.grassSound(),
49         
50         paramtype = "light",
51         
52         sunlight_propagates = true,
53         
54         drawtype = "plantlike",
55         
56         buildable_to = false,
57         
58         waving = 1,
59         
60         walkable = false,
61         --inventory_image   = def.inventory_image,
62         --walkable          = def.walkable,
63         --climbable         = def.climbable,
64         --paramtype2        = def.paramtype2,
65         --buildable_to      = def.buildable_to,
66         --selection_box     = def.selection_box,
67         --drop              = def.drop,
68         grows             = "up",
69         selection_box = {
70                 type = "fixed",
71                 fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16}
72         },
73 })
74
75 minetest.register_plant("grass", {
76     description = "Tall Grass",
77     drawtype = "plantlike",
78         waving = 1,
79         inventory_image = "tallgrass.png",
80         walkable = false,
81         climbable = false,
82         paramtype = "light",
83         is_ground_content = false,
84     tiles = {"tallgrass.png"},
85     paramtype2 = "degrotate",
86     buildable_to = true,
87     sunlight_propagates = true,
88     groups = {dig_immediate=1,attached_node=1,flammable=1},
89     sounds = main.grassSound(),
90     selection_box = {
91                 type = "fixed",
92                 fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 4 / 16, 4 / 16}
93         },
94         drop =  {
95                 max_items = 1,
96                 items= {
97                 {
98                         rarity = 10,
99                         items = {"farming:melon_seeds"},
100                 },
101                 {
102                         rarity = 10,
103                         items = {"farming:pumpkin_seeds"},
104                 },
105                 {
106                         rarity = 10,
107                         items = {"farming:wheat_seeds"},
108                 },
109                 },
110         },
111 })
112
113 minetest.register_plant("wheat", {
114             description = "Wheat",
115             drawtype = "plantlike",
116                 waving = 1,
117                 walkable = false,
118                 climbable = false,
119                 paramtype = "light",
120                 is_ground_content = false,      
121             tiles = {"wheat_stage"}, --automatically adds _X.png
122             paramtype2 = "degrotate",
123             buildable_to = false,
124             groups = {leaves = 1, plant = 1, axe = 1, hand = 0,dig_immediate=1,attached_node=1,crops=1},
125             sounds = main.grassSound(),
126             sunlight_propagates = true,
127             selection_box = {
128                         type = "fixed",
129                         fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -6 / 16, 6 / 16}
130                 },
131                 grows = "in_place",
132                 stages = 7,
133                 drop = {
134                         max_items = 2,
135                         items= {
136                          {
137                                 -- Only drop if using a tool whose name is identical to one
138                                 -- of these.
139                                 --rarity = 10,
140                                 items = {"farming:wheat"},
141                                 -- Whether all items in the dropped item list inherit the
142                                 -- hardware coloring palette color from the dug node.
143                                 -- Default is 'false'.
144                                 --inherit_color = true,
145                         },
146                         {
147                                 -- Only drop if using a tool whose name is identical to one
148                                 -- of these.
149                                 rarity = 2,
150                                 items = {"farming:wheat_seeds"},
151                                 -- Whether all items in the dropped item list inherit the
152                                 -- hardware coloring palette color from the dug node.
153                                 -- Default is 'false'.
154                                 --inherit_color = true,
155                         },
156                         },
157                         },
158                 
159                 
160                 --seed definition
161                 --"farming:wheat_1"
162                 seed_name = "wheat",
163                 seed_description = "Wheat Seeds",
164                 seed_inventory_image = "wheat_seeds.png",
165                 seed_plants = "farming:wheat_1",
166         })
167
168 minetest.register_plant("melon_stem", {
169             description = "Melon Stem",
170             drawtype = "plantlike",
171                 waving = 1,
172                 walkable = false,
173                 climbable = false,
174                 paramtype = "light",
175                 sunlight_propagates = true,
176                 is_ground_content = false,      
177             tiles = {"melon_stage"}, --automatically adds _X.png
178             buildable_to = false,
179             groups = {leaves = 1,plant=1, stem = 1, axe = 1, hand = 0,dig_immediate=1,attached_node=1,crops=1},
180             sounds = main.grassSound(),
181             selection_box = {
182                         type = "fixed",
183                         fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -6 / 16, 6 / 16}
184                 },
185                 grows = "in_place_yields",
186                 grown_node="farming:melon",
187                 stages = 7,
188                 --stem stage complete definition (fully grown and budding)
189                 stem_description = "",
190                 stem_tiles = {"nothing.png","nothing.png","melon_stage_complete.png^[transformFX","melon_stage_complete.png","nothing.png","nothing.png",},
191                 stem_drawtype = "nodebox",
192                 stem_walkable = false,
193                 stem_sunlight_propagates = true,
194                 stem_paramtype = "light",
195                 stem_node_box = {
196                         type = "fixed",
197                         fixed = {
198                                 {-0/16, -8/16, -7/16,  0/16, 8/16,  7/16}
199                         },
200                 },
201                 stem_selection_box = {
202                         type = "fixed",
203                         fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -6 / 16, 6 / 16}
204                 },
205                 stem_drop = {
206                         max_items = 2,
207                         items= {
208                         {
209                                 items = {"farming:melon_seeds"},
210                         },
211                         {
212                                 rarity = 2,
213                                 items = {"farming:melon_seeds"},
214                         },
215                         },
216                 },
217             stem_groups = {plant=1,dig_immediate=1,attached_node=1,crops=1},
218             stem_sounds = main.woodSound(),
219             
220             --fruit definition (what the stem creates)
221             fruit_name        = "melon",
222             fruit_description = "Melon",
223             fruit_tiles = {"melon_top.png","melon_top.png","melon_side.png","melon_side.png","melon_side.png","melon_side.png"},
224             fruit_groups = {pathable = 1,wood=1,flammable=1},
225             fruit_sounds = main.woodSound(),
226             fruit_drop  = {
227                         max_items = 6,
228                         items= {
229                                 {
230                                         items = {"farming:melon_slice"},
231                                 },
232                                 {
233                                         items = {"farming:melon_slice"},
234                                 },
235                                 {
236                                         items = {"farming:melon_slice"},
237                                 },
238                                 {
239                                         items = {"farming:melon_slice"},
240                                 },
241                                 {
242                                         rarity = 5,
243                                         items = {"farming:melon_slice"},
244                                 },
245                                 {
246                                         rarity = 15,
247                                         items = {"farming:melon_seeds"},
248                                 },
249                         },
250                 },
251                 
252                 --seed definition
253                 --"farming:wheat_1"
254                 seed_name = "melon",
255                 seed_description = "Melon Seeds",
256                 seed_inventory_image = "melon_seeds.png",
257                 seed_plants = "farming:melon_stem_1",
258 })
259
260 minetest.register_food("farming:melon_slice",{
261         description = "Melon Slice",
262         texture = "melon_slice.png",
263         satiation=1,
264         hunger=1,
265 })
266
267
268 minetest.register_plant("pumpkin_stem", {
269             description = "Pumpkin Stem",
270             drawtype = "plantlike",
271                 waving = 1,
272                 walkable = false,
273                 climbable = false,
274                 paramtype = "light",
275                 sunlight_propagates = true,
276                 is_ground_content = false,      
277             tiles = {"melon_stage"}, --automatically adds _X.png
278             buildable_to = false,
279             groups = {leaves = 1,plant=1, stem = 1, axe = 1, hand = 0,dig_immediate=1,attached_node=1,crops=1},
280             sounds = main.grassSound(),
281             selection_box = {
282                         type = "fixed",
283                         fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -6 / 16, 6 / 16}
284                 },
285                 grows = "in_place_yields",
286                 grown_node="farming:pumpkin",
287                 stages = 7,
288                 
289                 --stem stage complete definition (fully grown and budding)
290                 stem_description = "",
291                 stem_tiles = {"nothing.png","nothing.png","melon_stage_complete.png^[transformFX","melon_stage_complete.png","nothing.png","nothing.png",},
292                 stem_drawtype = "nodebox",
293                 stem_walkable = false,
294                 stem_sunlight_propagates = true,
295                 stem_paramtype = "light",
296                 stem_node_box = {
297                         type = "fixed",
298                         fixed = {
299                                 {-0/16, -8/16, -7/16,  0/16, 8/16,  7/16}
300                         },
301                 },
302                 stem_selection_box = {
303                         type = "fixed",
304                         fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -6 / 16, 6 / 16}
305                 },
306                 stem_drop = {
307                         max_items = 2,
308                         items= {
309                         {
310                                 items = {"farming:pumpkin_seeds"},
311                         },
312                         {
313                                 rarity = 2,
314                                 items = {"farming:pumpkin_seeds"},
315                         },
316                         },
317                 },
318             stem_groups = {plant=1,dig_immediate=1,attached_node=1,crops=1},
319             stem_sounds = main.woodSound(),
320             
321             --fruit definition (what the stem creates)
322             fruit_name        = "pumpkin",
323             fruit_description = "Pumpkin",
324             fruit_tiles = {"pumpkin_top.png","pumpkin_top.png","pumpkin_side.png","pumpkin_side.png","pumpkin_side.png","pumpkin_side.png"},
325             fruit_groups = {pathable = 1,wood=1,flammable=1},
326             fruit_sounds = main.woodSound(),
327                 --seed definition
328                 --"farming:wheat_1"
329                 seed_name = "pumpkin",
330                 seed_description = "Pumpkin Seeds",
331                 seed_inventory_image = "pumpkin_seeds.png",
332                 seed_plants = "farming:pumpkin_stem_1",
333 })
334
335 minetest.register_craft({
336         type = "shapeless",
337         output = "farming:pumpkin_seeds",
338         recipe = {"farming:pumpkin"},
339 })
340 minetest.register_craft({
341         type = "fuel",
342         recipe = "farming:pumpkin",
343         burntime = 3,
344 })
345
346 minetest.register_craft({
347         type = "cooking",
348         output = "farming:pumpkin_pie",
349         recipe = "farming:pumpkin",
350         cooktime = 2,
351 })
352
353
354 minetest.register_food("farming:pumpkin_pie",{
355         description = "Pumpkin Pie",
356         texture = "pumpkin_pie.png",
357         satiation=6,
358         hunger=3,
359 })
360
361 minetest.register_decoration({
362         name = "farming:sugarcane",
363         deco_type = "simple",
364         place_on = {"main:dirt","main:grass","main:sand"},
365         sidelen = 16,
366         noise_params = {
367                 offset = -0.3,
368                 scale = 0.7,
369                 spread = {x = 100, y = 100, z = 100},
370                 seed = 354,
371                 octaves = 3,
372                 persist = 0.7
373         },
374         y_max = 1,
375         y_min = 1,
376         decoration = "farming:sugarcane",
377         height = 2,
378         height_max = 5,
379         spawn_by = "main:water",
380         num_spawn_by = 1,
381 })
382
383
384 minetest.register_decoration({
385                 name = "farming:cactus",
386                 deco_type = "simple",
387                 place_on = {"main:sand"},
388                 sidelen = 16,
389                 noise_params = {
390                         offset = -0.012,
391                         scale = 0.024,
392                         spread = {x = 100, y = 100, z = 100},
393                         seed = 230,
394                         octaves = 3,
395                         persist = 0.6
396                 },
397                 y_max = 30,
398                 y_min = 0,
399                 decoration = "farming:cactus",
400                 height = 3,
401                 height_max = 4,
402         })
403
404
405 minetest.register_decoration({
406         deco_type = "simple",
407         place_on = "main:grass",
408         sidelen = 16,
409         fill_ratio = 0.5,
410         param2 = 0,
411         param2_max = 179,
412         --biomes = {"grassland"},
413         decoration = "farming:grass",
414         height = 1,
415 })