]> git.lizzy.rs Git - Crafter.git/blob - mods/nether/nodes.lua
remove server debug
[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:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
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                         items= {
46                                 {
47                                         tools = {"main:woodpick","main:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
48                                         items = {"nether:glowstone_dust"},
49                                 },
50                                 {
51                                         tools = {"main:woodpick","main:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
52                                         items = {"nether:glowstone_dust"},
53                                 },
54                                 {
55                                         tools = {"main:woodpick","main:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
56                                         items = {"nether:glowstone_dust"},
57                                 },
58                                 {
59                                         tools = {"main:woodpick","main:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
60                                         items = {"nether:glowstone_dust"},
61                                 },
62                                 {
63                                         rarity = 5,
64                                         tools = {"main:woodpick","main:coalpick","main:stonepick","main:ironpick","main:lapispick","main:goldpick","main:diamondpick","main:emeraldpick","main:sapphirepick","main:rubypick"},
65                                         items = {"nether:glowstone_dust"},
66                                 },
67                         },
68                 }
69 })
70
71 minetest.register_node("nether:obsidian", {
72     description = "Obsidian",
73     tiles = {"obsidian.png"},
74     groups = {obsidian = 1, pathable = 1},
75     --groups = {stone = 1, pathable = 1}, --leave this here for debug
76     sounds = main.stoneSound(),
77     is_ground_content = false,
78     after_destruct = function(pos, oldnode)
79                 destroy_nether_portal(pos)
80     end,
81     --light_source = 7,
82 })
83
84
85 minetest.register_node("nether:lava", {
86         description = "Lava",
87         drawtype = "liquid",
88         tiles = {
89                 {
90                         name = "lava_source.png",
91                         backface_culling = false,
92                         animation = {
93                                 type = "vertical_frames",
94                                 aspect_w = 16,
95                                 aspect_h = 16,
96                                 length = 2.0,
97                         },
98                 },
99                 {
100                         name = "lava_source.png",
101                         backface_culling = true,
102                         animation = {
103                                 type = "vertical_frames",
104                                 aspect_w = 16,
105                                 aspect_h = 16,
106                                 length = 2.0,
107                         },
108                 },
109         },
110         paramtype = "light",
111         light_source = 13,
112         walkable = false,
113         pointable = false,
114         diggable = false,
115         buildable_to = true,
116         is_ground_content = false,
117         drop = "",
118         drowning = 1,
119         liquidtype = "source",
120         liquid_alternative_flowing = "nether:lavaflow",
121         liquid_alternative_source = "nether:lava",
122         liquid_viscosity = 1,
123         liquid_renewable = true,
124         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
125         groups = {lava = 3, liquid = 2, igniter = 1, fire=1,hurt_inside=1},
126 })
127
128 minetest.register_node("nether:lavaflow", {
129         description = "Flowing Lava",
130         drawtype = "flowingliquid",
131         tiles = {"lava_flow.png"},
132         special_tiles = {
133                 {
134                         name = "lava_flow.png",
135                         backface_culling = false,
136                         animation = {
137                                 type = "vertical_frames",
138                                 aspect_w = 16,
139                                 aspect_h = 16,
140                                 length = 3.3,
141                         },
142                 },
143                 {
144                         name = "lava_flow.png",
145                         backface_culling = true,
146                         animation = {
147                                 type = "vertical_frames",
148                                 aspect_w = 16,
149                                 aspect_h = 16,
150                                 length = 3.3,
151                         },
152                 },
153         },
154         selection_box = {
155             type = "fixed",
156             fixed = {
157                 {0, 0, 0, 0, 0, 0},
158             },
159         },
160         paramtype = "light",
161         paramtype2 = "flowingliquid",
162         light_source = 13,
163         walkable = false,
164         pointable = false,
165         diggable = false,
166         buildable_to = true,
167         is_ground_content = false,
168         drop = "",
169         drowning = 1,
170         liquidtype = "flowing",
171         liquid_alternative_flowing = "nether:lavaflow",
172         liquid_alternative_source = "nether:lava",
173         liquid_viscosity = 1,
174         liquid_renewable = true,
175         post_effect_color = {a = 191, r = 255, g = 64, b = 0},
176         groups = {lava = 3, liquid = 2, igniter = 1, fire=1,hurt_inside=1},
177 })
178
179 local colorize_ratio = 125
180 minetest.register_node("nether:tree", {
181     description = "Nether Tree",
182     tiles = {"treeCore.png^[colorize:red:"..colorize_ratio,"treeCore.png^[colorize:red:"..colorize_ratio,"treeOut.png^[colorize:red:"..colorize_ratio,"treeOut.png^[colorize:red:"..colorize_ratio,"treeOut.png^[colorize:red:"..colorize_ratio,"treeOut.png^[colorize:red:"..colorize_ratio},
183     groups = {wood = 1, tree = 1, pathable = 1},
184     sounds = main.woodSound(),
185     --set metadata so treecapitator doesn't destroy houses
186     on_place = function(itemstack, placer, pointed_thing)
187                 if not pointed_thing.type == "node" then
188                         return
189                 end
190                 
191                 local sneak = placer:get_player_control().sneak
192                 local noddef = minetest.registered_nodes[minetest.get_node(pointed_thing.under).name]
193                 if not sneak and noddef.on_rightclick then
194                         minetest.item_place(itemstack, placer, pointed_thing)
195                         return
196                 end
197                 
198                 local pos = pointed_thing.above
199                 minetest.item_place_node(itemstack, placer, pointed_thing)
200                 local meta = minetest.get_meta(pos)
201                 meta:set_string("placed", "true")       
202                 return(itemstack)
203         end,
204         light_source = 7,
205         --treecapitator - move treecapitator into own file using override
206         on_dig = function(pos, node, digger)
207         
208                 --check if wielding axe?
209                 
210                 local meta = minetest.get_meta(pos)
211                 if not meta:contains("placed") then
212                         --remove tree
213                         for y = -6,6 do
214                                 local name = minetest.get_node(vector.new(pos.x,pos.y+y,pos.z)).name
215                                 --print(y)
216                                 if name == "nether:tree" then
217                                         minetest.node_dig(vector.new(pos.x,pos.y+y,pos.z), node, digger)
218                                 end
219                         end
220                 else
221                         minetest.node_dig(pos, node, digger)
222                 end     
223         end
224 })
225
226 minetest.register_node("nether:wood", {
227     description = "Nether Wood",
228     tiles = {"wood.png^[colorize:red:"..colorize_ratio},
229     groups = {wood = 1, pathable = 1},
230     sounds = main.woodSound(),
231     light_source = 7,
232 })
233
234
235 minetest.register_node("nether:leaves", {
236     description = "Nether Leaves",
237     drawtype = "allfaces_optional",
238         waving = 1,
239         walkable = false,
240         climbable = true,
241         paramtype = "light",
242         is_ground_content = false,      
243     tiles = {"leaves.png^[colorize:red:"..colorize_ratio},
244     groups = {leaves = 1, leafdecay = 1},
245     sounds = main.grassSound(),
246     light_source = 7,
247     drop = {
248                 max_items = 1,
249                 items= {
250                  {
251                         -- Only drop if using a tool whose name is identical to one
252                         -- of these.
253                         rarity = 10,
254                         items = {"main:sapling"},
255                         -- Whether all items in the dropped item list inherit the
256                         -- hardware coloring palette color from the dug node.
257                         -- Default is 'false'.
258                         --inherit_color = true,
259                 },
260                 {
261                         -- Only drop if using a tool whose name is identical to one
262                         -- of these.
263                         tools = {"main:shears"},
264                         rarity = 2,
265                         items = {"main:leaves"},
266                         -- Whether all items in the dropped item list inherit the
267                         -- hardware coloring palette color from the dug node.
268                         -- Default is 'false'.
269                         --inherit_color = true,
270                 },
271                 {
272                         -- Only drop if using a tool whose name is identical to one
273                         -- of these.
274                         tools = {"main:shears"},
275                         rarity = 2,
276                         items = {"main:stick"},
277                         -- Whether all items in the dropped item list inherit the
278                         -- hardware coloring palette color from the dug node.
279                         -- Default is 'false'.
280                         --inherit_color = true,
281                 },
282                 {
283                         -- Only drop if using a tool whose name is identical to one
284                         -- of these.
285                         tools = {"main:shears"},
286                         rarity = 6,
287                         items = {"main:apple"}, --golden apples
288                         -- Whether all items in the dropped item list inherit the
289                         -- hardware coloring palette color from the dug node.
290                         -- Default is 'false'.
291                         --inherit_color = true,
292                 },
293                 },
294     },
295 })