]> git.lizzy.rs Git - Crafter.git/blob - mods/main/nodes.lua
Add ore
[Crafter.git] / mods / main / nodes.lua
1 print("Initializing nodes")
2
3 minetest.register_node("main:stone", {
4     description = "Stone",
5     tiles = {"stone.png"},
6     groups = {stone = 1, hard = 1, pickaxe = 1, hand = 4},
7     sounds = main.stoneSound(),
8     drop="main:cobble",
9 })
10
11 local ores = {"coal","iron","gold","diamond"}
12 for id,ore in pairs(ores) do
13         minetest.register_node("main:"..ore.."ore", {
14                 description = ore:gsub("^%l", string.upper).." Ore",
15                 tiles = {"stone.png^"..ore.."ore.png"},
16                 groups = {stone = id, hard = id, pickaxe = 1, hand = 4},
17                 sounds = main.stoneSound(),
18                 --light_source = 14,--debugging ore spawn
19         })
20 end
21
22 minetest.register_node("main:cobble", {
23     description = "Cobblestone",
24     tiles = {"cobble.png"},
25     groups = {stone = 2, hard = 1, pickaxe = 2, hand = 4},
26     sounds = main.stoneSound(),
27 })
28
29 minetest.register_node("main:dirt", {
30     description = "Dirt",
31     tiles = {"dirt.png"},
32     groups = {dirt = 1, soft = 1, shovel = 1, hand = 1},
33     sounds = main.grassSound(),
34 })
35
36 minetest.register_node("main:grass", {
37     description = "Grass",
38     tiles = {"grass.png"},
39     groups = {dirt = 1, soft = 1, shovel = 1, hand = 1},
40     sounds = main.grassSound(),
41     drop="main:dirt",
42 })
43
44 minetest.register_node("main:sand", {
45     description = "Sand",
46     tiles = {"sand.png"},
47     groups = {dirt = 1, sand = 1, soft = 1, shovel = 1, hand = 1},
48     sounds = main.sandSound(),
49 })
50
51 minetest.register_node("main:tree", {
52     description = "Tree",
53     tiles = {"treeCore.png","treeCore.png","treeOut.png","treeOut.png","treeOut.png","treeOut.png"},
54     groups = {wood = 2, tree = 1, hard = 1, axe = 1, hand = 3},
55     sounds = main.woodSound(),
56 })
57
58 minetest.register_node("main:wood", {
59     description = "Wood",
60     tiles = {"wood.png"},
61     groups = {wood = 1, hard = 1, axe = 1, hand = 3},
62     sounds = main.woodSound(),
63 })
64
65 minetest.register_node("main:leaves", {
66     description = "Leaves",
67     drawtype = "allfaces_optional",
68         waving = 1,
69         walkable = false,
70         climbable = true,
71         paramtype = "light",
72         is_ground_content = false,      
73     tiles = {"leaves.png"},
74     groups = {leaves = 1, plant = 1, axe = 1, hand = 0, leafdecay = 1},
75     sounds = main.grassSound(),
76     drop = {
77                 max_items = 1,
78                 items= {
79                 {
80                         -- Only drop if using a tool whose name is identical to one
81                         -- of these.
82                         tools = {"main:shears"},
83                         rarity = 2,
84                         items = {"main:leaves"},
85                         -- Whether all items in the dropped item list inherit the
86                         -- hardware coloring palette color from the dug node.
87                         -- Default is 'false'.
88                         --inherit_color = true,
89                 },
90                 {
91                         -- Only drop if using a tool whose name is identical to one
92                         -- of these.
93                         tools = {"main:shears"},
94                         rarity = 2,
95                         items = {"main:stick"},
96                         -- Whether all items in the dropped item list inherit the
97                         -- hardware coloring palette color from the dug node.
98                         -- Default is 'false'.
99                         --inherit_color = true,
100                 },
101                 {
102                         -- Only drop if using a tool whose name is identical to one
103                         -- of these.
104                         tools = {"main:shears"},
105                         rarity = 6,
106                         items = {"main:apple"},
107                         -- Whether all items in the dropped item list inherit the
108                         -- hardware coloring palette color from the dug node.
109                         -- Default is 'false'.
110                         --inherit_color = true,
111                 },
112                 },
113     },
114 })
115
116 minetest.register_node("main:waterSource", {
117         description = "Water Source",
118         drawtype = "liquid",
119         waving = 3,
120         tiles = {
121                 {
122                         name = "waterSource.png",
123                         backface_culling = false,
124                         animation = {
125                                 type = "vertical_frames",
126                                 aspect_w = 16,
127                                 aspect_h = 16,
128                                 length = 2.0,
129                         },
130                 },
131                 {
132                         name = "waterSource.png",
133                         backface_culling = true,
134                         animation = {
135                                 type = "vertical_frames",
136                                 aspect_w = 16,
137                                 aspect_h = 16,
138                                 length = 2.0,
139                         },
140                 },
141         },
142         alpha = 191,
143         paramtype = "light",
144         walkable = false,
145         pointable = false,
146         diggable = false,
147         buildable_to = true,
148         is_ground_content = false,
149         drop = "",
150         drowning = 1,
151         liquidtype = "source",
152         liquid_alternative_flowing = "main:waterFlow",
153         liquid_alternative_source = "main:waterSource",
154         liquid_viscosity = 1,
155         post_effect_color = {a = 103, r = 30, g = 60, b = 90},
156         groups = {water = 1, liquid = 1, cools_lava = 1, bucket = 1, source = 1},
157         --sounds = default.node_sound_water_defaults(),
158 })
159
160 minetest.register_node("main:waterFlow", {
161         description = "Water Flow",
162         drawtype = "flowingliquid",
163         waving = 3,
164         tiles = {"water.png"},
165         special_tiles = {
166                 {
167                         name = "waterFlow.png",
168                         backface_culling = false,
169                         animation = {
170                                 type = "vertical_frames",
171                                 aspect_w = 16,
172                                 aspect_h = 16,
173                                 length = 0.8,
174                         },
175                 },
176                 {
177                         name = "waterFlow.png",
178                         backface_culling = true,
179                         animation = {
180                                 type = "vertical_frames",
181                                 aspect_w = 16,
182                                 aspect_h = 16,
183                                 length = 0.8,
184                         },
185                 },
186         },
187         alpha = 191,
188         paramtype = "light",
189         paramtype2 = "flowingliquid",
190         walkable = false,
191         pointable = false,
192         diggable = false,
193         buildable_to = true,
194         is_ground_content = false,
195         drop = "",
196         drowning = 1,
197         liquidtype = "flowing",
198         liquid_alternative_flowing = "main:waterFlow",
199         liquid_alternative_source = "main:waterSource",
200         liquid_viscosity = 1,
201         post_effect_color = {a = 103, r = 30, g = 60, b = 90},
202         groups = {water = 1, liquid = 1, notInCreative = 1, cools_lava = 1},
203         --sounds = default.node_sound_water_defaults(),
204 })
205
206 --[[
207
208 minetest.register_node("default:lava_source", {
209         description = S("Lava Source"),
210         drawtype = "liquid",
211         tiles = {
212                 {
213                         name = "default_lava_source_animated.png",
214                         backface_culling = false,
215                         animation = {
216                                 type = "vertical_frames",
217                                 aspect_w = 16,
218                                 aspect_h = 16,
219                                 length = 3.0,
220                         },
221                 },
222                 {
223                         name = "default_lava_source_animated.png",
224                         backface_culling = true,
225                         animation = {
226                                 type = "vertical_frames",
227                                 aspect_w = 16,
228                                 aspect_h = 16,
229                                 length = 3.0,
230                         },
231                 },
232         },
233         paramtype = "light",
234         light_source = default.LIGHT_MAX - 1,
235         walkable = false,
236         pointable = false,
237         diggable = false,
238         buildable_to = true,
239         is_ground_content = false,
240         drop = "",
241         drowning = 1,
242         liquidtype = "source",
243         liquid_alternative_flowing = "default:lava_flowing",
244         liquid_alternative_source = "default:lava_source",
245         liquid_viscosity = 7,
246         liquid_renewable = false,
247         damage_per_second = 4 * 2,
248         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
249         groups = {lava = 3, liquid = 2, igniter = 1},
250 })
251
252 minetest.register_node("default:lava_flowing", {
253         description = S("Flowing Lava"),
254         drawtype = "flowingliquid",
255         tiles = {"default_lava.png"},
256         special_tiles = {
257                 {
258                         name = "default_lava_flowing_animated.png",
259                         backface_culling = false,
260                         animation = {
261                                 type = "vertical_frames",
262                                 aspect_w = 16,
263                                 aspect_h = 16,
264                                 length = 3.3,
265                         },
266                 },
267                 {
268                         name = "default_lava_flowing_animated.png",
269                         backface_culling = true,
270                         animation = {
271                                 type = "vertical_frames",
272                                 aspect_w = 16,
273                                 aspect_h = 16,
274                                 length = 3.3,
275                         },
276                 },
277         },
278         paramtype = "light",
279         paramtype2 = "flowingliquid",
280         light_source = default.LIGHT_MAX - 1,
281         walkable = false,
282         pointable = false,
283         diggable = false,
284         buildable_to = true,
285         is_ground_content = false,
286         drop = "",
287         drowning = 1,
288         liquidtype = "flowing",
289         liquid_alternative_flowing = "default:lava_flowing",
290         liquid_alternative_source = "default:lava_source",
291         liquid_viscosity = 7,
292         liquid_renewable = false,
293         damage_per_second = 4 * 2,
294         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
295         groups = {lava = 3, liquid = 2, igniter = 1,
296                 not_in_creative_inventory = 1},
297 })
298
299 ]]--