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