Added code from ender-overlay