Add setting for TNT drop rate

This commit is contained in:
Nils Dagsson Moskopp 2022-04-17 05:44:14 +02:00
parent 32d89d6d5f
commit 5acc9191fa
No known key found for this signature in database
GPG Key ID: A3BC671C35191080
2 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,5 @@
local S = minetest.get_translator("mcl_tnt")
local tnt_drop_rate = tonumber(minetest.settings:get("mcl_tnt_drop_rate") or 0.25)
local tnt_griefing = minetest.settings:get_bool("mcl_tnt_griefing", true)
local mod_death_messages = minetest.get_modpath("mcl_death_messages")
@ -180,7 +181,7 @@ function TNT:on_step(dtime)
self.blinkstatus = not self.blinkstatus
end
if self.timer > tnt.BOOMTIMER then
mcl_explosions.explode(self.object:get_pos(), 4, {}, self.object)
mcl_explosions.explode(self.object:get_pos(), 4, { drop_chance = tnt_drop_rate }, self.object)
self.object:remove()
end
end

View File

@ -24,6 +24,9 @@ mcl_doWeatherCycle (Change weather) bool true
# Note that blocks never have drops when in Creative Mode.
mcl_doTileDrops (Blocks have drops) bool true
# Chance of a node destroyed by a TNT explosion to be dropped as an item
mcl_tnt_drop_rate (TNT drop rate) float 0.25 0.0 1.0
# If enabled, TNT explosions destroy blocks.
mcl_tnt_griefing (TNT destroys blocks) bool true