using System; using RobocraftX.Common.Input; using RobocraftX.Multiplayer.Input; using GamecraftModdingAPI.Blocks; using GamecraftModdingAPI.Utility; using Harmony; namespace GamecraftModdingAPI.Inventory { public static class Hotbar { private static HotbarEngine hotbarEngine = new HotbarEngine(); public static void EquipBlock(BlockIDs block, uint playerID = uint.MaxValue) { if (playerID == uint.MaxValue) { playerID = hotbarEngine.GetLocalPlayerID(); } hotbarEngine.SelectBlock((int) block, playerID); // cubeSelectedByPick = true will crash the game // (this would be equivalent to mouse middle click pick block action) // reason: the game expects a Dictionary entry for the tweaked stats } public static BlockIDs GetEquippedBlock() { return HotbarSlotSelectionHandlerEnginePatch.EquippedPartID; } public static void Init() { GameEngineManager.AddGameEngine(hotbarEngine); } } }