Made Core Logger Only Gettable

This commit is contained in:
Exil Productions
2025-11-11 22:03:48 +01:00
parent a9493c78bd
commit b1e5cc6f25

19
Core.cs
View File

@@ -15,11 +15,26 @@ namespace VMM
{ {
internal class Core : MelonMod internal class Core : MelonMod
{ {
public static MelonLogger.Instance Logger { get; private set; } public static MelonLogger.Instance Logger
{
get
{
if (_logger != null)
{
return _logger;
}
else
{
throw new System.Exception("Logger instance is not initialized yet.");
}
}
}
private static MelonLogger.Instance _logger;
public override void OnInitializeMelon() public override void OnInitializeMelon()
{ {
Logger = LoggerInstance; _logger = LoggerInstance;
LoggerInstance.Msg("Initialized."); LoggerInstance.Msg("Initialized.");
} }