]> git.lizzy.rs Git - Crafter.git/blob - mods/nether/nodes.lua
Merge pull request #9 from Treer/master
[Crafter.git] / mods / nether / nodes.lua
1
2 minetest.register_node("nether:bedrock", {
3     description = "Bedrock",
4     tiles = {"bedrock.png"},
5     groups = {unbreakable = 1, pathable = 1},
6     sounds = main.stoneSound(),
7     is_ground_content = false,
8     --light_source = 14, --debugging
9 })
10
11
12 minetest.register_node("nether:netherrack", {
13     description = "Netherrack",
14     tiles = {"netherrack.png"},
15     groups = {netherrack = 1, pathable = 1},
16     sounds = main.stoneSound(),
17     is_ground_content = false,
18     light_source = 7,
19     drop = {
20                         max_items = 1,
21                         items= {
22                                 {
23                                         rarity = 0,
24                                         tools = {"main:woodpick","main:stonepick","main:ironpick","main:goldpick","main:diamondpick"},
25                                         items = {"nether:netherrack"},
26                                 },
27                                 },
28                         },
29 })
30 minetest.register_node("nether:glowstone", {
31     description = "Glowstone",
32     tiles = {"glowstone.png"},
33     groups = {glass = 1, pathable = 1},
34     sounds = main.stoneSound({
35                 footstep = {name = "glass_footstep", gain = 0.4},
36         dug =  {name = "break_glass", gain = 0.4},
37         }),
38     is_ground_content = false,
39     light_source = 12,
40     drop = {
41                         max_items = 5,
42                         tools = tool_required,
43                         items= {
44                                 {
45                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
46                                         items = {"nether:glowstone_dust"},
47                                 },
48                                 {
49                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
50                                         items = {"nether:glowstone_dust"},
51                                 },
52                                 {
53                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
54                                         items = {"nether:glowstone_dust"},
55                                 },
56                                 {
57                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
58                                         items = {"nether:glowstone_dust"},
59                                 },
60                                 {
61                                         rarity = 5,
62                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
63                                         items = {"nether:glowstone_dust"},
64                                 },
65                         },
66                 }
67 })
68
69 minetest.register_node("nether:obsidian", {
70     description = "Obsidian",
71     tiles = {"obsidian.png"},
72     groups = {stone = 5, pathable = 1},
73     --groups = {stone = 1, pathable = 1}, --leave this here for debug
74     sounds = main.stoneSound(),
75     is_ground_content = false,
76     after_destruct = function(pos, oldnode)
77                 destroy_nether_portal(pos)
78     end,
79     --light_source = 7,
80 })
81
82
83 minetest.register_node("nether:lava", {
84         description = "Lava",
85         drawtype = "liquid",
86         tiles = {
87                 {
88                         name = "lava_source.png",
89                         backface_culling = false,
90                         animation = {
91                                 type = "vertical_frames",
92                                 aspect_w = 16,
93                                 aspect_h = 16,
94                                 length = 2.0,
95                         },
96                 },
97                 {
98                         name = "lava_source.png",
99                         backface_culling = true,
100                         animation = {
101                                 type = "vertical_frames",
102                                 aspect_w = 16,
103                                 aspect_h = 16,
104                                 length = 2.0,
105                         },
106                 },
107         },
108         paramtype = "light",
109         light_source = 13,
110         walkable = false,
111         pointable = false,
112         diggable = false,
113         buildable_to = true,
114         is_ground_content = false,
115         drop = "",
116         drowning = 1,
117         liquidtype = "source",
118         liquid_alternative_flowing = "nether:lavaflow",
119         liquid_alternative_source = "nether:lava",
120         liquid_viscosity = 1,
121         liquid_renewable = true,
122         damage_per_second = 4 * 2,
123         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
124         groups = {lava = 3, liquid = 2, igniter = 1},
125 })
126
127 minetest.register_node("nether:lavaflow", {
128         description = "Flowing Lava",
129         drawtype = "flowingliquid",
130         tiles = {"lava_flow.png"},
131         special_tiles = {
132                 {
133                         name = "lava_flow.png",
134                         backface_culling = false,
135                         animation = {
136                                 type = "vertical_frames",
137                                 aspect_w = 16,
138                                 aspect_h = 16,
139                                 length = 3.3,
140                         },
141                 },
142                 {
143                         name = "lava_flow.png",
144                         backface_culling = true,
145                         animation = {
146                                 type = "vertical_frames",
147                                 aspect_w = 16,
148                                 aspect_h = 16,
149                                 length = 3.3,
150                         },
151                 },
152         },
153         selection_box = {
154             type = "fixed",
155             fixed = {
156                 {0, 0, 0, 0, 0, 0},
157             },
158         },
159         paramtype = "light",
160         paramtype2 = "flowingliquid",
161         light_source = 13,
162         walkable = false,
163         pointable = false,
164         diggable = false,
165         buildable_to = true,
166         is_ground_content = false,
167         drop = "",
168         drowning = 1,
169         liquidtype = "flowing",
170         liquid_alternative_flowing = "nether:lavaflow",
171         liquid_alternative_source = "nether:lava",
172         liquid_viscosity = 1,
173         liquid_renewable = true,
174         damage_per_second = 2,
175         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
176         groups = {lava = 3, liquid = 2, igniter = 1},
177 })
178
179 local ores = {"redstone_","coal","iron","gold","diamond"}
180 local tool = {"main:woodpick","main:stonepick","main:ironpick","main:goldpick","main:diamondpick"}
181 for id,ore in pairs(ores) do
182
183         if id > 1 then
184                 id = id - 1
185         end
186         local tool_required = {}
187         for i = id,5 do
188                 table.insert(tool_required, tool[i])
189         end
190
191         
192
193         local drops = {
194                         max_items = 1,
195                         items= {
196                                 {
197                                         rarity = 0,
198                                         tools = tool_required,
199                                         items = {"nether:"..ore.."ore"},
200                                 },
201                                 },
202                         }
203         if ore == "diamond" then 
204                 drops = {
205                         max_items = 1,
206                         items= {
207                                 {
208                                         rarity = 0,
209                                         tools = tool_required,
210                                         items = {"main:diamond"},
211                                 },
212                                 },
213                         }
214         elseif ore == "coal" then 
215                 drops = {
216                         max_items = 1,
217                         items= {
218                                 {
219                                         rarity = 0,
220                                         tools = tool_required,
221                                         items = {"main:coal"},
222                                 },
223                                 },
224                         }
225         elseif ore == "redstone_" then
226                 drops = {
227                         max_items = 5,
228                         tools = tool_required,
229                         items= {
230                                 {
231                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
232                                         items = {"redstone:dust"},
233                                 },
234                                 {
235                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
236                                         items = {"redstone:dust"},
237                                 },
238                                 {
239                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
240                                         items = {"redstone:dust"},
241                                 },
242                                 {
243                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
244                                         items = {"redstone:dust"},
245                                 },
246                                 {
247                                         rarity = 5,
248                                         tools = {"main:ironpick","main:goldpick","main:diamondpick"},
249                                         items = {"redstone:dust"},
250                                 },
251                         },
252                 }
253         end
254         
255         minetest.register_node("nether:"..ore.."ore", {
256                 description = ore:gsub("^%l", string.upper).." Ore",
257                 tiles = {"netherrack.png^"..ore.."ore.png"},
258                 groups = {netherrack = id, pathable = 1},
259                 sounds = main.stoneSound(),
260                 light_source = 7,
261                 drop = drops,
262                 after_destruct = function(pos, oldnode)
263                         if math.random() > 0.95 then
264                                 minetest.sound_play("tnt_ignite")
265                                 minetest.after(3, function(pos)
266                                         tnt(pos,9)
267                                 end,pos)
268                         end
269                 end,
270         })
271 end