diff options
-rw-r--r-- | LICENSE | 3 | ||||
-rw-r--r-- | README.txt | 37 | ||||
-rw-r--r-- | init.lua | 13 |
3 files changed, 48 insertions, 5 deletions
@@ -0,0 +1,3 @@ +Sounds: alarm.ogg + Source: https://commons.wikimedia.org/wiki/File:BABS_-_Allgemeiner_Alarm.ogg + License: Public domain
\ No newline at end of file diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..df98f7e --- /dev/null +++ b/README.txt @@ -0,0 +1,37 @@ +Minetest Game mod: tnt +====================== +by PilzAdam and ShadowNinja + +Introduction: +This mod adds TNT to Minetest. TNT is a tool to help the player +in mining. + +How to use the mod: +Craft gunpowder by placing coal and gravel in the crafting area. The +gunpowder can be used to craft TNT or as fuze for TNT. To craft TNT +surround gunpowder with 4 wood in a + shape. +There are different ways to blow up TNT: + 1. Hit it with a torch. + 2. Hit a gunpowder fuze that leads to a TNT block with a torch. + 3. Activate it with mesecons (fastest way) +Be aware of the damage radius of 7 blocks! + +License: +WTFPL (see below) + +See also: +http://minetest.net/ + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. @@ -3,6 +3,8 @@ tnt = {} local singleplayer = minetest.is_singleplayer() local setting = minetest.setting_getbool("enable_tnt") setting = true -- this mod is multiplayer-safe, so enable it. +local tntmindepth = tonumber(minetest.setting_get("tnt_mindepth")) or -100 + if (not singleplayer and setting ~= true) or (singleplayer and setting == false) then return @@ -364,8 +366,8 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast) end function tnt.boom(pos, def) - if pos.y > -100 then --- minetest.chat_send_all("TNT can only explode when deeper than -100") + if pos.y > tntmindepth then +-- check if we're deep enough minetest.set_node(pos, {name = "tnt:tnt"}) return end @@ -417,9 +419,10 @@ minetest.register_node("tnt:gunpowder", { sounds = default.node_sound_leaves_defaults(), on_punch = function(pos, node, puncher) - if puncher:get_wielded_item():get_name() == "default:torch" then - tnt.burn(pos) - end + if puncher:get_wielded_item():get_name() == "default:torch" and pos.y < (tntmindepth + 16)then + -- check if we're deep enough, don't annoy people with the air-raid sound. + tnt.burn(pos) + end end, on_blast = function(pos, intensity) tnt.burn(pos) |