forked from VoxeLibre/VoxeLibre
Do not drop items in creative mode
It works like this in Minecraft. This will also reduce lag when playing with TNT in creative.
This commit is contained in:
parent
64c767ad8c
commit
a62a75c799
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
mcl_explosions = {}
|
mcl_explosions = {}
|
||||||
|
|
||||||
|
local creative_mode = minetest.settings:get_bool("creative_mode")
|
||||||
|
|
||||||
-- Saved sphere explosion shapes for various radiuses
|
-- Saved sphere explosion shapes for various radiuses
|
||||||
local sphere_shapes = {}
|
local sphere_shapes = {}
|
||||||
|
|
||||||
|
@ -344,7 +346,7 @@ local function trace_explode(pos, strength, raydirs, radius, drop_chance)
|
||||||
|
|
||||||
-- Remove destroyed blocks and drop items
|
-- Remove destroyed blocks and drop items
|
||||||
for hash, idx in pairs(destroy) do
|
for hash, idx in pairs(destroy) do
|
||||||
local do_drop = math.random() <= drop_chance
|
local do_drop = not creative_mode and math.random() <= drop_chance
|
||||||
local on_blast = node_on_blast[data[idx]]
|
local on_blast = node_on_blast[data[idx]]
|
||||||
local remove = true
|
local remove = true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue