mirror of
https://github.com/minetest-mods/item_drop.git
synced 2024-12-23 06:12:30 +01:00
Add settings for pickups and drops
This commit is contained in:
parent
d9581ec795
commit
a666252f1c
7
init.lua
7
init.lua
@ -1,3 +1,7 @@
|
|||||||
|
local enable_item_pickup = minetest.settings:get_bool("enable_item_pickup") or true
|
||||||
|
local enable_item_drops = minetest.settings:get_bool("enable_item_drops") or true
|
||||||
|
|
||||||
|
if enable_item_pickup then
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
for _,player in ipairs(minetest.get_connected_players()) do
|
for _,player in ipairs(minetest.get_connected_players()) do
|
||||||
if player:get_hp() > 0 or not minetest.settings:get_bool("enable_damage") then
|
if player:get_hp() > 0 or not minetest.settings:get_bool("enable_damage") then
|
||||||
@ -68,8 +72,10 @@ minetest.register_globalstep(function(dtime)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
if enable_item_drops then
|
||||||
function minetest.handle_node_drops(pos, drops, digger)
|
function minetest.handle_node_drops(pos, drops, digger)
|
||||||
local inv
|
local inv
|
||||||
if minetest.settings:get_bool("creative_mode") and digger and digger:is_player() then
|
if minetest.settings:get_bool("creative_mode") and digger and digger:is_player() then
|
||||||
@ -110,6 +116,7 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if minetest.settings:get("log_mods") then
|
if minetest.settings:get("log_mods") then
|
||||||
minetest.log("action", "item_drop loaded")
|
minetest.log("action", "item_drop loaded")
|
||||||
|
Loading…
Reference in New Issue
Block a user