forked from VoxeLibre/VoxeLibre
Add setting for TNT drop rate
This commit is contained in:
parent
32d89d6d5f
commit
5acc9191fa
|
@ -1,4 +1,5 @@
|
||||||
local S = minetest.get_translator("mcl_tnt")
|
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 tnt_griefing = minetest.settings:get_bool("mcl_tnt_griefing", true)
|
||||||
|
|
||||||
local mod_death_messages = minetest.get_modpath("mcl_death_messages")
|
local mod_death_messages = minetest.get_modpath("mcl_death_messages")
|
||||||
|
@ -180,7 +181,7 @@ function TNT:on_step(dtime)
|
||||||
self.blinkstatus = not self.blinkstatus
|
self.blinkstatus = not self.blinkstatus
|
||||||
end
|
end
|
||||||
if self.timer > tnt.BOOMTIMER then
|
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()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,6 +24,9 @@ mcl_doWeatherCycle (Change weather) bool true
|
||||||
# Note that blocks never have drops when in Creative Mode.
|
# Note that blocks never have drops when in Creative Mode.
|
||||||
mcl_doTileDrops (Blocks have drops) bool true
|
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.
|
# If enabled, TNT explosions destroy blocks.
|
||||||
mcl_tnt_griefing (TNT destroys blocks) bool true
|
mcl_tnt_griefing (TNT destroys blocks) bool true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue