mirror of
https://github.com/minetest-mods/item_drop.git
synced 2025-07-17 13:20:22 +02:00
Compare commits
5 Commits
soundpitch
...
c6a80bd4fa
Author | SHA1 | Date | |
---|---|---|---|
c6a80bd4fa | |||
fadfbf7e05 | |||
c1637b1975 | |||
e10486d2aa | |||
2730deca16 |
12
init.lua
12
init.lua
@ -1,5 +1,4 @@
|
|||||||
local load_time_start = minetest.get_us_time()
|
local load_time_start = minetest.get_us_time()
|
||||||
math.randomseed(os.time())
|
|
||||||
|
|
||||||
-- Functions which can be overridden by mods
|
-- Functions which can be overridden by mods
|
||||||
item_drop = {
|
item_drop = {
|
||||||
@ -100,7 +99,6 @@ if legacy_setting_getbool("item_drop.enable_item_pickup",
|
|||||||
minetest.sound_play("item_drop_pickup", {
|
minetest.sound_play("item_drop_pickup", {
|
||||||
pos = pos,
|
pos = pos,
|
||||||
gain = pickup_gain,
|
gain = pickup_gain,
|
||||||
pitch = (100 - (math.random(-2, 2)) * 10) / 100,
|
|
||||||
})
|
})
|
||||||
if pickup_particle then
|
if pickup_particle then
|
||||||
local item = minetest.registered_nodes[
|
local item = minetest.registered_nodes[
|
||||||
@ -375,7 +373,13 @@ and not minetest.settings:get_bool("creative_mode") then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function minetest.handle_node_drops(pos, drops)
|
local old_handle_node_drops = minetest.handle_node_drops
|
||||||
|
function minetest.handle_node_drops(pos, drops, player)
|
||||||
|
if player.is_fake_player then
|
||||||
|
-- Node Breaker or similar machines should receive items in the
|
||||||
|
-- inventory
|
||||||
|
return old_handle_node_drops(pos, drops, player)
|
||||||
|
end
|
||||||
for i = 1,#drops do
|
for i = 1,#drops do
|
||||||
local item = drops[i]
|
local item = drops[i]
|
||||||
if type(item) == "string" then
|
if type(item) == "string" then
|
||||||
@ -413,5 +417,5 @@ local msg = "[item_drop] loaded after ca. " .. time .. " seconds."
|
|||||||
if time > 0.01 then
|
if time > 0.01 then
|
||||||
print(msg)
|
print(msg)
|
||||||
else
|
else
|
||||||
minetest.log("info", msg)
|
minetest.log("action", msg)
|
||||||
end
|
end
|
||||||
|
BIN
sounds/item_drop_pickup.2.ogg
Normal file
BIN
sounds/item_drop_pickup.2.ogg
Normal file
Binary file not shown.
BIN
sounds/item_drop_pickup.3.ogg
Normal file
BIN
sounds/item_drop_pickup.3.ogg
Normal file
Binary file not shown.
BIN
sounds/item_drop_pickup.4.ogg
Normal file
BIN
sounds/item_drop_pickup.4.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user