Remove serializer registration at startup
This commit is contained in:
parent
500cb9b716
commit
ebea9da232
2 changed files with 9 additions and 7 deletions
|
@ -3,7 +3,7 @@
|
|||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Version>1.0.1</Version>
|
||||
<Version>1.0.2</Version>
|
||||
<Authors>Exmods</Authors>
|
||||
<PackageLicenseExpression>GNU General Public Licence 3+</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://git.exmods.org/modtainers/GamecraftModdingAPI</PackageProjectUrl>
|
||||
|
|
|
@ -35,6 +35,12 @@ namespace GamecraftModdingAPI.Utility
|
|||
/// </summary>
|
||||
public static void Enable()
|
||||
{
|
||||
if (!SerializerManager.ExistsSerializer(typeof(ModVersionStruct).FullName))
|
||||
{
|
||||
SerializerManager.AddSerializer<ModVersionDescriptor>(new SimpleEntitySerializer<ModVersionDescriptor>(
|
||||
(_) => { return new EGID[1] { new EGID(0u, ApiExclusiveGroups.versionGroup) }; }
|
||||
));
|
||||
}
|
||||
EventManager.AddEventEmitter(versionEngine);
|
||||
isEnabled = true;
|
||||
}
|
||||
|
@ -48,12 +54,8 @@ namespace GamecraftModdingAPI.Utility
|
|||
isEnabled = false;
|
||||
}
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
SerializerManager.AddSerializer<ModVersionDescriptor>(new SimpleEntitySerializer<ModVersionDescriptor>(
|
||||
(_) => { return new EGID[1] { new EGID(0u, ApiExclusiveGroups.versionGroup) }; }
|
||||
));
|
||||
}
|
||||
public static void Init() { }
|
||||
|
||||
}
|
||||
|
||||
internal class VersionTrackingEngine : IEventEmitterEngine
|
||||
|
|
Loading…
Reference in a new issue