local ____exports = {}
local postPlayerInit
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
function postPlayerInit(self, _player)
    local players = Isaac.FindByType(EntityType.PLAYER)
    if #players == 0 then
        Isaac.ExecuteCommand("reloadshaders")
    end
end
--- Using the "luamod" console command with a mod that has custom shaders can crash the game. A
-- simple fix for this is automatically applied to any upgraded mods. This method was originally
-- discovered by AgentCucco.
-- 
-- This code is not put inside of a feature class because we want it to apply to every upgraded mod,
-- but we do not want to have any mandatory features. Mandatory features are confusing for end-users
-- since the type of their upgraded mod would contain features that they did not explicitly enable.
function ____exports.applyShaderCrashFix(self, mod)
    mod:AddCallback(ModCallback.POST_PLAYER_INIT, postPlayerInit)
end
return ____exports
