Heard something about some sort of attributes being deprecated in MT 5.0.0 ...
Wasn't sure if those were player attributes, or if other entities could have attributes and will have them deprecated... But I've been messing a lot with player attributes in my upcoming projects and am just wondering if player attributes aren't getting removed or something
Are player attributes getting removed in 5.0.0 ?
- davidthecreator
- Member
- Posts: 452
- Joined: Mon Aug 18, 2014 19:48
- GitHub: daviddoesminetest
- In-game: DavidDoesMinetest
- Location: Lithuania
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: Are player attributes getting removed in 5.0.0 ?
Player Attributes are deprecated in 5.0.0, which means that you are encouraged to not use them in mods.
Player Attributes are replaced by player meta, which uses the same API as node and item meta, and mod storage.
Player Attributes may be removed in the future, but removing deprecated functions only tends to happen during major releases - eg: 6.0.0
Before:
After:
It's worth noting that depends.txt and description.txt are also deprecated in 5.0.0, but we probably won't ever remove support for them.
Player Attributes are replaced by player meta, which uses the same API as node and item meta, and mod storage.
Player Attributes may be removed in the future, but removing deprecated functions only tends to happen during major releases - eg: 6.0.0
Before:
Code: Select all
player:set_attribute("foo", "123")
print(tonumber(player:get_attribute("foo")))
Code: Select all
local meta = player:get_meta()
meta:set_int("foo", 123)
print(meta:get_int("foo"))
It's worth noting that depends.txt and description.txt are also deprecated in 5.0.0, but we probably won't ever remove support for them.
- davidthecreator
- Member
- Posts: 452
- Joined: Mon Aug 18, 2014 19:48
- GitHub: daviddoesminetest
- In-game: DavidDoesMinetest
- Location: Lithuania
Re: Are player attributes getting removed in 5.0.0 ?
Oh... Ok...rubenwardy wrote:Player Attributes are deprecated, which means that you are encouraged to not use them in mods.
Player Attributes are replaced by player meta, which uses the same API as node and item meta, and mod storage.
Player Attributes may be removed in the future, but removing deprecated functions only tends to happen during major releases - eg: 6.0.0
Before:
After:Code: Select all
player:set_attribute("foo", "123") print(tonumber(player:get_attribute("foo")))
Code: Select all
local meta = player:get_meta() meta:set_int("foo", 123) print(meta:get_int("foo"))
It's worth noting that depends.txt and description.txt are also deprecated in 5.0.0, but we probably won't ever remove support for them.
Thanks!
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Are player attributes getting removed in 5.0.0 ?
Are the player attributes already deprecated? I can't remember seeing deprecation warnings when using them in 0.4.17.1.
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: Are player attributes getting removed in 5.0.0 ?
In 5.0.0, yesLinuxdirk wrote:Are the player attributes already deprecated? I can't remember seeing deprecation warnings when using them in 0.4.17.1.
Re: Are player attributes getting removed in 5.0.0 ?
That's good to know. What's the new mechanism for mod/game dependencies then?rubenwardy wrote:It's worth noting that depends.txt and description.txt are also deprecated in 5.0.0, but we probably won't ever remove support for them.
-
- Member
- Posts: 167
- Joined: Mon May 22, 2017 20:27
Re: Are player attributes getting removed in 5.0.0 ?
Not to derail the thread but the new format is mod.conf. Read the documentation here: https://github.com/minetest/minetest/bl ... i.txt#L155Exilyth wrote:That's good to know. What's the new mechanism for mod/game dependencies then?rubenwardy wrote:It's worth noting that depends.txt and description.txt are also deprecated in 5.0.0, but we probably won't ever remove support for them.
Who is online
Users browsing this forum: No registered users and 3 guests