mirror of
https://github.com/minetest-mods/item_drop.git
synced 2025-01-05 12:27:31 +01:00
Add settings for pickups and drops
This commit is contained in:
parent
2d42301d85
commit
04f75caeb3
11
init.lua
11
init.lua
@ -1,4 +1,8 @@
|
|||||||
minetest.register_globalstep(function(dtime)
|
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)
|
||||||
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
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
@ -68,9 +72,11 @@ minetest.register_globalstep(function(dtime)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function minetest.handle_node_drops(pos, drops, digger)
|
if enable_item_drops then
|
||||||
|
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
|
||||||
inv = digger:get_inventory()
|
inv = digger:get_inventory()
|
||||||
@ -109,6 +115,7 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.settings:get("log_mods") then
|
if minetest.settings:get("log_mods") then
|
||||||
|
Loading…
Reference in New Issue
Block a user