Skip to content

Commit 0aebf86

Browse files
WuzzyEkdohibs
Wuzzy
authored andcommittedJun 7, 2015
Add gunpowder trails
Uses group “connect_to_raillike”
1 parent 016fa0d commit 0aebf86

13 files changed

+33
-4
lines changed
 

‎game_api.txt

+2
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ Use `minetest.raillike_group(<Name>)` to get the group value.
218218
| Node type | Raillike group name
219219
+-----------------------+----------------------------------
220220
| default:rail | "rail"
221+
| tnt:gunpowder | "gunpowder"
222+
| tnt:gunpowder_burning | "gunpowder"
221223

222224
Example:
223225
If you want to add a new rail type and want it to connect with default:rail,

‎mods/tnt/init.lua

+31-4
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,14 @@ minetest.register_node("tnt:gunpowder", {
270270
paramtype = "light",
271271
sunlight_propagates = true,
272272
walkable = false,
273-
tiles = {"tnt_gunpowder.png",},
273+
tiles = {"tnt_gunpowder_straight.png", "tnt_gunpowder_curved.png", "tnt_gunpowder_t_junction.png", "tnt_gunpowder_crossing.png"},
274274
inventory_image = "tnt_gunpowder_inventory.png",
275275
wield_image = "tnt_gunpowder_inventory.png",
276276
selection_box = {
277277
type = "fixed",
278278
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
279279
},
280-
groups = {dig_immediate=2,attached_node=1},
280+
groups = {dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("gunpowder")},
281281
sounds = default.node_sound_leaves_defaults(),
282282

283283
on_punch = function(pos, node, puncher)
@@ -297,7 +297,34 @@ minetest.register_node("tnt:gunpowder_burning", {
297297
walkable = false,
298298
light_source = 5,
299299
tiles = {{
300-
name = "tnt_gunpowder_burning_animated.png",
300+
name = "tnt_gunpowder_burning_straight_animated.png",
301+
animation = {
302+
type = "vertical_frames",
303+
aspect_w = 16,
304+
aspect_h = 16,
305+
length = 1,
306+
}
307+
},
308+
{
309+
name = "tnt_gunpowder_burning_curved_animated.png",
310+
animation = {
311+
type = "vertical_frames",
312+
aspect_w = 16,
313+
aspect_h = 16,
314+
length = 1,
315+
}
316+
},
317+
{
318+
name = "tnt_gunpowder_burning_t_junction_animated.png",
319+
animation = {
320+
type = "vertical_frames",
321+
aspect_w = 16,
322+
aspect_h = 16,
323+
length = 1,
324+
}
325+
},
326+
{
327+
name = "tnt_gunpowder_burning_crossing_animated.png",
301328
animation = {
302329
type = "vertical_frames",
303330
aspect_w = 16,
@@ -310,7 +337,7 @@ minetest.register_node("tnt:gunpowder_burning", {
310337
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
311338
},
312339
drop = "",
313-
groups = {dig_immediate=2,attached_node=1},
340+
groups = {dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("gunpowder")},
314341
sounds = default.node_sound_leaves_defaults(),
315342
on_timer = function(pos, elapsed)
316343
for dx = -1, 1 do

‎mods/tnt/textures/tnt_gunpowder.png

-336 Bytes
Binary file not shown.
-344 Bytes
Binary file not shown.
-203 Bytes
Binary file not shown.
Loading
Loading
Loading
Loading
245 Bytes
Loading
268 Bytes
Loading
225 Bytes
Loading
328 Bytes
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.