Browse Source

Fix Block type exception on unsynced Specialize<T>()

tags/v1.2.0
NGnius (Graham) 4 years ago
parent
commit
6a137472c1
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      GamecraftModdingAPI/Blocks/BlockEngine.cs

+ 10
- 0
GamecraftModdingAPI/Blocks/BlockEngine.cs View File

@@ -104,11 +104,21 @@ namespace GamecraftModdingAPI.Blocks

public bool BlockExists(EGID id)
{
if (!Synced)
{
Sync();
Synced = true;
}
return entitiesDB.Exists<DBEntityStruct>(id);
}

public bool GetBlockInfoExists<T>(EGID blockID) where T : struct, IEntityComponent
{
if (!Synced)
{
Sync();
Synced = true;
}
return entitiesDB.Exists<T>(blockID);
}



Loading…
Cancel
Save