maikerumine / grieftest

A MC like game with challenging mobs
GNU Lesser General Public License v2.1
5 stars 0 forks source link

minetest.create_detached_inventory updates #2

Closed Fixer-007 closed 7 years ago

Fixer-007 commented 8 years ago

There were changes to minetest.create_detached_inventory function, due to bug https://github.com/minetest/minetest/issues/4403, there were fixes merged: https://github.com/minetest/minetest/pull/4812 and https://github.com/minetest/minetest_game/pull/1413.

Basically on player join all other players detached inventories were send to player causing him to have severe 0 0 0 bug for several minutes on some servers. This was fixed, but some mod makers should check their mods for use of this function to send only his player inventory to him if needed.

Also quoting sfan5 about minetest.create_detached_inventory(player:get_player_name():

everything with :get_player_name() definitely need a fix

New function info:

* `minetest.create_detached_inventory(name, callbacks, [player_name])`: returns an `InvRef`
    * callbacks: See "Detached inventory callbacks"
    * player_name: Make detached inventory available to one player exclusively,
      by default they will be sent to every player (even if not used).
      Note that this parameter is mostly just a workaround and will be removed in future releases.
    * Creates a detached inventory. If it already exists, it is cleared.

Your mod has this:

grieftest/mods/a_inventory/enderchest/init.lua:8:   local ender_inv = minetest.create_detached_inventory(player:get_player_name().."ender")

I hope I described it right. Some mods are already updated. This post is copy pasted. If not sure ask on IRC.

maikerumine commented 7 years ago

Fixed!