瀏覽代碼

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

tags/v1.2.0
NGnius (Graham) 4 年之前
父節點
當前提交
6a137472c1
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. +10
    -0
      GamecraftModdingAPI/Blocks/BlockEngine.cs

+ 10
- 0
GamecraftModdingAPI/Blocks/BlockEngine.cs 查看文件

@@ -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…
取消
儲存