From 0ad03acf469a900ff11009cd3a843783b5845aea Mon Sep 17 00:00:00 2001 From: AFCMS Date: Thu, 13 May 2021 22:55:17 +0200 Subject: [PATCH] improve mcl_worlds API --- mods/CORE/mcl_worlds/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/CORE/mcl_worlds/init.lua b/mods/CORE/mcl_worlds/init.lua index 6cdeaab7e0..435ce51c7f 100644 --- a/mods/CORE/mcl_worlds/init.lua +++ b/mods/CORE/mcl_worlds/init.lua @@ -112,10 +112,11 @@ local last_dimension = {} -- * player: Player who changed the dimension -- * dimension: New dimension ("overworld", "nether", "end", "void") function mcl_worlds.dimension_change(player, dimension) + local playername = player:get_player_name() for i=1, #mcl_worlds.registered_on_dimension_change do - mcl_worlds.registered_on_dimension_change[i](player, dimension) - last_dimension[player:get_player_name()] = dimension + mcl_worlds.registered_on_dimension_change[i](player, dimension, last_dimension[playername]) end + last_dimension[playername] = dimension end ----------------------- INTERNAL STUFF ----------------------