Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add the player name to dropped items
The player name is now added in the field "dropped_by" on the created entity.
- Loading branch information
1 parent
76c9abe
commit 0876623
Showing
2 changed files
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -348,7 +348,7 @@ function core.item_place(itemstack, placer, pointed_thing, param2) | |
end | ||
|
||
function core.item_drop(itemstack, dropper, pos) | ||
if dropper.is_player then | ||
if dropper and dropper:is_player() then | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
est31
Contributor
|
||
local v = dropper:get_look_dir() | ||
local p = {x=pos.x, y=pos.y+1.2, z=pos.z} | ||
local cs = itemstack:get_count() | ||
|
@@ -362,6 +362,7 @@ function core.item_drop(itemstack, dropper, pos) | |
v.y = v.y*2 + 2 | ||
v.z = v.z*2 | ||
obj:setvelocity(v) | ||
obj:get_luaentity().dropped_by = dropper:get_player_name() | ||
return itemstack | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeworks seems to stop working now
https://github.com/VanessaE/pipeworks/blob/master/item_transport.lua#L252