Compare commits
5 Commits
70b3386322
...
770f4a0dc5
Author | SHA1 | Date |
---|---|---|
Ginger88895 | 770f4a0dc5 | |
texmex | 26d0532cbd | |
texmex | becdfd113a | |
Panquesito7 | 934ebff45a | |
HybridDog | 5069afa834 |
|
@ -43,7 +43,7 @@ developed by [PilzAdam](https://github.com/PilzAdam/item_drop).
|
|||
* Left and Right keys combined (`LeftAndRight`)
|
||||
* Right mouse button (`RMB`)
|
||||
* Sneak key and right mouse button combined (`SneakAndRMB`)
|
||||
* If `item_drop.pickup_keyinvert` is `true` (false by default), items are
|
||||
* If `item_drop.pickup_keyinvert` is `true`, items are
|
||||
collected when the key is not pressed instead of when it's pressed.
|
||||
* Displays a particle of the picked item above the player if
|
||||
`item_drop.pickup_particle` is `true` (true by default)
|
||||
|
|
22
init.lua
22
init.lua
|
@ -57,7 +57,7 @@ if legacy_setting_getbool("item_drop.enable_item_pickup",
|
|||
local key_triggered = legacy_setting_getbool("item_drop.enable_pickup_key",
|
||||
"enable_item_pickup_key", true)
|
||||
local key_invert = minetest.settings:get_bool(
|
||||
"item_drop.pickup_keyinvert") or false
|
||||
"item_drop.pickup_keyinvert") ~= false
|
||||
local keytype
|
||||
if key_triggered then
|
||||
keytype = minetest.settings:get("item_drop.pickup_keytype") or
|
||||
|
@ -145,7 +145,7 @@ if legacy_setting_getbool("item_drop.enable_item_pickup",
|
|||
if zero_velocity_mode then
|
||||
function opt_get_ent(object)
|
||||
if object:is_player()
|
||||
or not vector.equals(object:getvelocity(), {x=0, y=0, z=0}) then
|
||||
or not vector.equals(object:get_velocity(), {x=0, y=0, z=0}) then
|
||||
return
|
||||
end
|
||||
local ent = object:get_luaentity()
|
||||
|
@ -260,7 +260,7 @@ if legacy_setting_getbool("item_drop.enable_item_pickup",
|
|||
return
|
||||
end
|
||||
|
||||
local pos = player:getpos()
|
||||
local pos = player:get_pos()
|
||||
pos.y = pos.y+0.5
|
||||
local inv
|
||||
|
||||
|
@ -284,7 +284,7 @@ if legacy_setting_getbool("item_drop.enable_item_pickup",
|
|||
local flying_item
|
||||
local pos2
|
||||
if magnet_mode then
|
||||
pos2 = object:getpos()
|
||||
pos2 = object:get_pos()
|
||||
flying_item = vector.distance(pos, pos2) > pickup_radius
|
||||
end
|
||||
if not flying_item then
|
||||
|
@ -332,15 +332,11 @@ if legacy_setting_getbool("item_drop.enable_item_drop", "enable_item_drop", true
|
|||
and not minetest.settings:get_bool("creative_mode") then
|
||||
function minetest.handle_node_drops(pos, drops)
|
||||
for i = 1,#drops do
|
||||
local item = drops[i]
|
||||
local item = ItemStack(drops[i])
|
||||
local count, name
|
||||
if type(item) == "string" then
|
||||
count = 1
|
||||
name = item
|
||||
else
|
||||
count = item:get_count()
|
||||
name = item:get_name()
|
||||
end
|
||||
|
||||
count = item:get_count()
|
||||
name = item:get_name()
|
||||
|
||||
-- Sometimes nothing should be dropped
|
||||
if name == ""
|
||||
|
@ -354,7 +350,7 @@ and not minetest.settings:get_bool("creative_mode") then
|
|||
error("Couldn't spawn item " .. name .. ", drops: " .. dump(drops))
|
||||
end
|
||||
|
||||
local vel = obj:getvelocity()
|
||||
local vel = obj:get_velocity()
|
||||
local x = math.random(-5, 4)
|
||||
if x >= 0 then
|
||||
x = x+1
|
||||
|
|
|
@ -8,7 +8,7 @@ item_drop.enable_item_drop (Enable item drops) bool true
|
|||
item_drop.enable_pickup_key (Use pickup key) bool true
|
||||
|
||||
#Collect items when the key is not pressed instead of when it is pressed
|
||||
item_drop.pickup_keyinvert (Invert pickup key) bool false
|
||||
item_drop.pickup_keyinvert (Invert pickup key) bool true
|
||||
|
||||
#What keytype to use as pickup key
|
||||
item_drop.pickup_keytype (Pickup keytype) enum Use Use,Sneak,LeftAndRight,RMB,SneakAndRMB
|
||||
|
|
Loading…
Reference in New Issue