Add setting for disabling manual item pickups by mouse

This commit is contained in:
tacotexmex 2019-02-12 01:12:59 +01:00
parent 726b5f4872
commit 8e89c148be
3 changed files with 10 additions and 0 deletions

View File

@ -31,6 +31,8 @@ developed by [PilzAdam](https://github.com/PilzAdam/item_drop).
items between these radii are flying to the player for
`item_drop.magnet_time` seconds, after this time, they're picked or stop
flying.
* Enable manual item pickups by mouse only if `item_drop.mouse_pickup` is
`true` (true by default)
* Plays a sound when the items are picked up with the gain level set to
`item_drop.pickup_sound_gain` (default 0.2)
* Requires a key to be pressed in order to pick items if

View File

@ -54,6 +54,11 @@ minetest.settings:get_bool("enable_item_pickup") ~= false then
pickup_age = math.min(pickup_age, 0)
end
end
local mouse_pickup = minetest.settings:get_bool(
"item_drop.mouse_pickup") ~= false
if not mouse_pickup then
minetest.registered_entities["__builtin:item"].pointable = false
end
local magnet_mode = magnet_radius > pickup_radius
local zero_velocity_mode = pickup_age == -1

View File

@ -33,3 +33,6 @@ item_drop.magnet_time (Magnet time) float 5.0
#Time delay in seconds after autopicking an item if it's dropped by a player
item_drop.pickup_age (Pickup age) float 0.5
#Enable manual item pickups by mouse
item_drop.mouse_pickup (Mouse pickup) bool true