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.

Removal.cs 840B

12345678910111213141516171819202122232425262728
  1. using Svelto.ECS;
  2. using GamecraftModdingAPI.Utility;
  3. namespace GamecraftModdingAPI.Blocks
  4. {
  5. public class Removal
  6. {
  7. private static RemovalEngine _removalEngine = new RemovalEngine();
  8. /// <summary>
  9. /// Removes the block with the given ID. Returns false if the block doesn't exist or the game isn't in build mode.
  10. /// </summary>
  11. /// <param name="targetBlock">The block to remove</param>
  12. /// <returns>Whether the block was successfully removed</returns>
  13. public static bool RemoveBlock(EGID targetBlock)
  14. {
  15. if (GameState.IsBuildMode())
  16. return _removalEngine.RemoveBlock(targetBlock);
  17. return false;
  18. }
  19. public static void Init()
  20. {
  21. GameEngineManager.AddGameEngine(_removalEngine);
  22. }
  23. }
  24. }