mirror of
https://github.com/minetest-mods/item_drop.git
synced 2025-01-03 11:37:36 +01:00
Look for legacy setting names
This commit is contained in:
parent
b576e882a7
commit
08ba364510
17
init.lua
17
init.lua
@ -1,9 +1,11 @@
|
|||||||
local load_time_start = minetest.get_us_time()
|
local load_time_start = minetest.get_us_time()
|
||||||
|
pickup_radius = tonumber(minetest.settings:get("item_pickup_radius"))
|
||||||
|
|
||||||
|
if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false or
|
||||||
if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false then
|
minetest.settings:get_bool("enable_item_pickup") ~= false then
|
||||||
local pickup_gain = tonumber(
|
local pickup_gain = tonumber(
|
||||||
minetest.settings:get("item_drop.pickup_sound_gain")) or 0.2
|
minetest.settings:get("item_drop.pickup_sound_gain")) or
|
||||||
|
tonumber(minetest.settings:get("item_pickup_gain")) or 0.2
|
||||||
local pickup_radius = tonumber(
|
local pickup_radius = tonumber(
|
||||||
minetest.settings:get("item_drop.pickup_radius")) or 0.75
|
minetest.settings:get("item_drop.pickup_radius")) or 0.75
|
||||||
local magnet_radius = tonumber(
|
local magnet_radius = tonumber(
|
||||||
@ -13,12 +15,14 @@ if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false then
|
|||||||
local pickup_age = tonumber(
|
local pickup_age = tonumber(
|
||||||
minetest.settings:get("item_drop.pickup_age")) or 0.5
|
minetest.settings:get("item_drop.pickup_age")) or 0.5
|
||||||
local key_triggered = minetest.settings:get_bool(
|
local key_triggered = minetest.settings:get_bool(
|
||||||
"item_drop.enable_pickup_key") ~= false
|
"item_drop.enable_pickup_key") or
|
||||||
|
minetest.settings:get_bool("enable_item_pickup_key") ~= false
|
||||||
local key_invert = minetest.settings:get_bool(
|
local key_invert = minetest.settings:get_bool(
|
||||||
"item_drop.pickup_keyinvert") or false
|
"item_drop.pickup_keyinvert") or false
|
||||||
local keytype
|
local keytype
|
||||||
if key_triggered then
|
if key_triggered then
|
||||||
keytype = minetest.settings:get("item_drop.pickup_keytype") or "Use"
|
keytype = minetest.settings:get("item_drop.pickup_keytype") or
|
||||||
|
minetest.settings:get("item_pickup_keytype") or "Use"
|
||||||
-- disable pickup age if picking is explicitly enabled by the player
|
-- disable pickup age if picking is explicitly enabled by the player
|
||||||
if not key_invert then
|
if not key_invert then
|
||||||
pickup_age = math.min(pickup_age, 0)
|
pickup_age = math.min(pickup_age, 0)
|
||||||
@ -202,7 +206,8 @@ if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false then
|
|||||||
minetest.after(3.0, pickup_step)
|
minetest.after(3.0, pickup_step)
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.settings:get_bool("item_drop.enable_item_drop") ~= false
|
if minetest.settings:get_bool("item_drop.enable_item_drop") ~= false or
|
||||||
|
minetest.settings:get_bool("enable_item_drop") ~= false
|
||||||
and not minetest.settings:get_bool("creative_mode") then
|
and not minetest.settings:get_bool("creative_mode") then
|
||||||
function minetest.handle_node_drops(pos, drops)
|
function minetest.handle_node_drops(pos, drops)
|
||||||
for i = 1,#drops do
|
for i = 1,#drops do
|
||||||
|
Loading…
Reference in New Issue
Block a user