public string PlaceAt(DefinitionId blockDefinitionId, PlainVec3D position, PlainVec3D orientationForward,
                       PlainVec3D orientationUp)
 {
     Definitions.CheckDefinitionIdExists(blockDefinitionId.ToMyDefinitionId());
     return(m_blockPlacer.PlaceSingleBlock(m_session.CurrentCharacterId, blockDefinitionId, position.ToVector3(), orientationForward.ToVector3(),
                                           orientationUp.ToVector3()).BlockId().ToString());
 }
        public string PlaceInGrid(DefinitionId blockDefinitionId, string gridId, PlainVec3I minPosition, PlainVec3I orientationForward,
                                  PlainVec3I orientationUp)
        {
            Definitions.CheckDefinitionIdExists(blockDefinitionId.ToMyDefinitionId());
            //var playerId = m_session.Character.GetPlayerId();
            var grid = m_observer.GetGridById(gridId);

            return(m_blockPlacer.PlaceInGrid(
                       blockDefinitionId.ToMyCubeBlockDefinition().Id, grid, minPosition.ToVector3I(),
                       orientationForward.ToVector3I(), orientationUp.ToVector3I(), MySession.Static.LocalPlayerId
                       ).UniqueId.ToString());
        }
Exemple #3
0
        public void SetToolbarItem(DefinitionId definitionId, ToolbarLocation toolbarLocation)
        {
            var myDefinitionId = definitionId.ToMyDefinitionId();

            Definitions.CheckDefinitionIdExists(myDefinitionId);
            if (IsWeapon(definitionId.Type))
            {
                SetToolbarItem <MyObjectBuilder_ToolbarItemWeapon>(myDefinitionId, toolbarLocation);
            }
            else
            {
                SetToolbarItem <MyObjectBuilder_ToolbarItemCubeBlock>(myDefinitionId, toolbarLocation);
            }
        }