Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

150 bones inventory slots and register_transfer_inventory_to_bones_on_player_death callback #3030

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b0545dc
bones: bones are now holding 150 item slots and register_transfer_inv…
imre84 May 5, 2023
3dad8a5
fixes as per code review completed
imre84 May 5, 2023
eeec7d6
fixes as per code review completed (2)
imre84 May 6, 2023
5141c96
fixes as per code review completed (3)
imre84 May 12, 2023
4b22280
fixes as per code review completed (4)
imre84 May 29, 2023
224ae80
Use Minetest's `table.insert_all`
appgurueu May 29, 2023
bd60bfb
Fix `table.insert` usage
appgurueu May 29, 2023
738e0d7
Refactor
appgurueu May 30, 2023
9e52fc1
Make Luacheck happy
appgurueu May 30, 2023
b62713f
PR #3030 fix
imre84 Feb 24, 2024
5b35ea5
as per https://github.com/minetest/minetest_game/pull/3030#pullreques…
imre84 Feb 24, 2024
da3c36d
NS routine as per code review
imre84 Feb 27, 2024
25ff385
fix for https://github.com/minetest/minetest_game/pull/3030#pullreque…
imre84 Mar 23, 2024
062fc46
doc clarification
imre84 Mar 23, 2024
e27ad58
as per https://github.com/minetest/minetest_game/pull/3030#discussion…
imre84 Mar 28, 2024
7c119fe
scrollbar vs bones formspec
imre84 Mar 28, 2024
9d41427
debug code removed
imre84 Mar 28, 2024
704f11d
testing/debug code to make the bones go full, needs to be reverted
imre84 Mar 30, 2024
e7d483b
scroll fix
imre84 Mar 30, 2024
dfd0805
whitespace fix
imre84 Mar 30, 2024
5879783
bones inventory reordering
imre84 Mar 30, 2024
48099eb
luacheck fix
imre84 Mar 30, 2024
e62cfaa
whitespace fix
imre84 Mar 31, 2024
cd8cb78
coding style fix
imre84 Mar 31, 2024
cc6b859
coding style fix
imre84 Mar 31, 2024
5cc2b46
coding style fix
imre84 Mar 31, 2024
c2cfa87
to make bones_mode = keep work
imre84 Mar 31, 2024
357f87a
minetest.conf.example updated with bones_max_slots
imre84 Mar 31, 2024
dbfaad4
cb renamed to callback
imre84 Mar 31, 2024
c29990b
debug code reverted
imre84 Mar 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ read_globals = {
"Settings",
"unpack",
-- Silence errors about custom table methods.
table = { fields = { "copy", "indexof" } },
table = { fields = { "copy", "indexof", "insert_all" } },
-- Silence warnings about accessing undefined fields of global 'math'
math = { fields = { "sign" } }
}
Expand Down
11 changes: 11 additions & 0 deletions game_api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ in `bones.player_inventory_lists`.

e.g. `table.insert(bones.player_inventory_lists, "backpack")`

Additionally, callbacks can be registered to transfer items to the bones on death:

`bones.register_collect_items(callback)`

Functions registered this way won't be called if `bones_mode` is `keep` or in case of the death of a creative player.

`callback` is a `function(player)` which `return`s a table of items to be transferred.

Please note that this does not remove the items from the inventory they were taken of.
Disposing of the items in this inventory is the `callback`'s responsibility.


Creative API
------------
Expand Down
3 changes: 3 additions & 0 deletions minetest.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# keep: Player keeps items.
#bones_mode = bones

# Sets the maximum item slots inside a bones node. Anything above this limit will be dropped
#bones_max_slots = 150

# The time in seconds after which the bones of a dead player can be looted by
# everyone.
# 0 to disable.
Expand Down