TechbloxModdingAPI/GamecraftModdingAPI/Blocks/Removal.cs

28 lines
840 B
C#
Raw Normal View History

2020-04-12 23:31:06 +00:00
using Svelto.ECS;
using GamecraftModdingAPI.Utility;
namespace GamecraftModdingAPI.Blocks
{
public class Removal
{
private static RemovalEngine _removalEngine = new RemovalEngine();
/// <summary>
/// Removes the block with the given ID. Returns false if the block doesn't exist or the game isn't in build mode.
/// </summary>
/// <param name="targetBlock">The block to remove</param>
/// <returns>Whether the block was successfully removed</returns>
public static bool RemoveBlock(EGID targetBlock)
{
if (GameState.IsBuildMode())
return _removalEngine.RemoveBlock(targetBlock);
return false;
}
public static void Init()
{
GameEngineManager.AddGameEngine(_removalEngine);
}
}
}