Added new method onGamemodeChange() that clears player inventory if they change gamemodes.