Skip to content

Add igniter playername to tnt node metadata

Loïc Blot requested to merge pull/1070/igniter into master

Created by: jhcole

It is useful for protection mods to know who caused a tnt block to explode. tnt can be ignited in the following ways:

  • punched by player holding torch
  • adjacent to:
    • tnt:gunpowder_burning
    • fire:basic_flame,
    • default:lava_source,
    • default:lava_flowing

It can also be caused to explode immediatly by the following:

  • blast from another tnt explosion
  • turned on by mesecons

For the punching and gunpowder ignition methods, this commit adds an igniter key to the node's node metadata to track the player's playername, and passes this name to the minetest protection check. This node metadata is not available if the tnt node falls before exploding (bug #4087). Considering each of the other methods: it is difficult to determine the player responsible for adjacent fire, or lava; the on_blast callback doesn't provide any information on the source of a blast; and mesecons could be activated by a variety of non-player sources; so in those cases, no igniter information is available or passed on to protection checks.

Thoughts and/or suggestions will be appreciated.

Merge request reports