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