A stable modding interface between Techblox and mods https://mod.exmods.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
847B

  1. using System.Threading.Tasks;
  2. using Svelto.ECS;
  3. namespace GamecraftModdingAPI.Utility
  4. {
  5. public static class AsyncUtils
  6. {
  7. private static AsyncUtilsEngine gameEngine = new AsyncUtilsEngine();
  8. /// <summary>
  9. /// Waits for entity submission asynchronously.
  10. /// Use after placing a block or otherwise creating things in the game to access their properties.
  11. /// </summary>
  12. public static async Task WaitForSubmission()
  13. {
  14. await gameEngine.WaitForSubmission();
  15. }
  16. public static void Setup(EnginesRoot enginesRoot)
  17. {
  18. gameEngine.Setup(enginesRoot.GenerateEntityFunctions(), enginesRoot.GenerateEntityFactory());
  19. }
  20. public static void Init()
  21. {
  22. GameEngineManager.AddGameEngine(gameEngine);
  23. }
  24. }
  25. }