forked from VoxeLibre/VoxeLibre
improve mcl_worlds API
This commit is contained in:
parent
3097df731d
commit
0ad03acf46
|
@ -112,10 +112,11 @@ local last_dimension = {}
|
||||||
-- * player: Player who changed the dimension
|
-- * player: Player who changed the dimension
|
||||||
-- * dimension: New dimension ("overworld", "nether", "end", "void")
|
-- * dimension: New dimension ("overworld", "nether", "end", "void")
|
||||||
function mcl_worlds.dimension_change(player, dimension)
|
function mcl_worlds.dimension_change(player, dimension)
|
||||||
|
local playername = player:get_player_name()
|
||||||
for i=1, #mcl_worlds.registered_on_dimension_change do
|
for i=1, #mcl_worlds.registered_on_dimension_change do
|
||||||
mcl_worlds.registered_on_dimension_change[i](player, dimension)
|
mcl_worlds.registered_on_dimension_change[i](player, dimension, last_dimension[playername])
|
||||||
last_dimension[player:get_player_name()] = dimension
|
|
||||||
end
|
end
|
||||||
|
last_dimension[playername] = dimension
|
||||||
end
|
end
|
||||||
|
|
||||||
----------------------- INTERNAL STUFF ----------------------
|
----------------------- INTERNAL STUFF ----------------------
|
||||||
|
|
Loading…
Reference in New Issue