Class MyCubeBlock
  
  
  
  
    Inheritance
    System.Object
    
    MyCubeBlock
      
      
      
      
      
   
  
  
  
  Assembly: Sandbox.Game.dll
  Syntax
  
    public class MyCubeBlock : MyEntity, IMyComponentOwner<MyIDModule>, IMyUpgradableBlock, IMyCubeBlock, IMyEntity, IMyUpgradableBlock, IMyCubeBlock, IMyEntity
   
  Constructors
  
  
  
  
  MyCubeBlock()
  
  
  Declaration
  
  Fields
  
  
  
  CurrentAttachedUpgradeModules
  
  
  Declaration
  
    public Dictionary<long, MyCubeBlock.AttachedUpgradeModule> CurrentAttachedUpgradeModules
   
  Field Value
  
  
  
  DUMMY_SUBBLOCK_ID
  
  
  Declaration
  
    protected static readonly string DUMMY_SUBBLOCK_ID
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
  
  HandleEmissiveStateChange
  
  
  Declaration
  
    public bool HandleEmissiveStateChange
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  InitSkinUpdateHandled
  
  
  Declaration
  
    public bool InitSkinUpdateHandled
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  IsBeingRemoved
  
  
  Declaration
  
    public bool IsBeingRemoved
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  IsSilenced
  
  
  Declaration
  
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  m_activeEffects
  
  
  Declaration
  
    protected List<MyCubeBlockEffect> m_activeEffects
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Collections.Generic.List<Sandbox.Game.ParticleEffects.MyCubeBlockEffect> |  | 
    
  
  
  
  m_emissiveNames
  
  
  Declaration
  
    public static MyCubeBlock.EmissiveNames m_emissiveNames
   
  Field Value
  
  
  
  m_forceBlockDestructible
  
  
  Declaration
  
    protected bool m_forceBlockDestructible
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  m_soundEmitter
  
  
  Declaration
  
    public MyEntity3DSoundEmitter m_soundEmitter
   
  Field Value
  
  
  
  MAX_CUSTOM_NAME_LENGTH
  
  
  Declaration
  
    public const int MAX_CUSTOM_NAME_LENGTH = 512
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Int32 |  | 
    
  
  
  
  SilenceInChange
  
  
  Declaration
  
    public bool SilenceInChange
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  SlimBlock
  
  
  Declaration
  
    public MySlimBlock SlimBlock
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | Sandbox.Game.Entities.Cube.MySlimBlock |  | 
    
  
  
  
  SubBlocks
  Map from dummy name to subblock (subgrid, note that after grid split the subblock instance will be the same)
Declaration
  
    protected Dictionary<string, MySlimBlock> SubBlocks
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Collections.Generic.Dictionary<System.String, Sandbox.Game.Entities.Cube.MySlimBlock> |  | 
    
  
  
  
  UsedUpdateEveryFrame
  
  
  Declaration
  
    public bool UsedUpdateEveryFrame
   
  Field Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  Properties
  
  
  
  
  BlockDefinition
  
  
  Declaration
  
    public MyCubeBlockDefinition BlockDefinition { get; }
   
  Property Value
  
  
  
  
  BuiltBy
  
  
  Declaration
  
    public long BuiltBy { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Int64 |  | 
    
  
  
  
  
  CheckConnectionAllowed
  
  
  Declaration
  
    public bool CheckConnectionAllowed { get; set; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  CubeGrid
  
  
  Declaration
  
    public MyCubeGrid CubeGrid { get; }
   
  Property Value
  
  
  
  
  DefinitionDisplayNameText
  
  
  Declaration
  
    public string DefinitionDisplayNameText { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
  
  
  DisassembleRatio
  
  
  Declaration
  
    public virtual float DisassembleRatio { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Single |  | 
    
  
  
  
  
  ForceBlockDestructible
  
  
  Declaration
  
    public bool ForceBlockDestructible { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  HasDamageEffect
  
  
  Declaration
  
    protected bool HasDamageEffect { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  HighlightMode
  
  
  Declaration
  
    public virtual MyCubeBlockHighlightModes HighlightMode { get; }
   
  Property Value
  
  
  
  
  IDModule
  
  
  Declaration
  
    public MyIDModule IDModule { get; }
   
  Property Value
  
  
  
  
  IsBeingHacked
  
  
  Declaration
  
    public virtual bool IsBeingHacked { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsBuilt
  
  
  Declaration
  
    public bool IsBuilt { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsFunctional
  
  
  Declaration
  
    public bool IsFunctional { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsSubBlock
  
  
  Declaration
  
    public bool IsSubBlock { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IsWorking
  
  
  Declaration
  
    public bool IsWorking { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  Max
  
  
  Declaration
  
    public Vector3I Max { get; }
   
  Property Value
  
  
  
  
  Min
  
  
  Declaration
  
    public Vector3I Min { get; }
   
  Property Value
  
  
  
  
  NumberInGrid
  
  
  Declaration
  
    public int NumberInGrid { get; set; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Int32 |  | 
    
  
  
  
  
  Orientation
  
  
  Declaration
  
    public MyBlockOrientation Orientation { get; }
   
  Property Value
  
  
  
  
  OwnerBlock
  If the block is subblock then OwnerBlock is set to block which owns (spawns) subblocks (subgrids)
Declaration
  
    public MySlimBlock OwnerBlock { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | Sandbox.Game.Entities.Cube.MySlimBlock |  | 
    
  
  
  
  
  OwnerId
  
  
  Declaration
  
    public long OwnerId { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Int64 |  | 
    
  
  
  
  
  Physics
  
  
  Declaration
  
    public MyPhysicsBody Physics { get; set; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | Sandbox.Engine.Physics.MyPhysicsBody |  | 
    
  
  
  
  
  Position
  
  
  Declaration
  
    public Vector3I Position { get; }
   
  Property Value
  
  
  
  
  ResourceSink
  
  
  Declaration
  
    public MyResourceSinkComponent ResourceSink { get; set; }
   
  Property Value
  
  
  
  
  SubBlockName
  Name of subblock (key in the owner's subblocks map).
Declaration
  
    public string SubBlockName { get; set; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
  
  
  UpgradeValues
  
  
  Declaration
  
    public Dictionary<string, float> UpgradeValues { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Collections.Generic.Dictionary<System.String, System.Single> |  | 
    
  
  
  
  
  UseObjectsComponent
  
  
  Declaration
  
    public MyUseObjectsComponentBase UseObjectsComponent { get; }
   
  Property Value
  
  
  
  
  UsesEmissivePreset
  
  
  Declaration
  
    public bool UsesEmissivePreset { get; }
   
  Property Value
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  Methods
  
  
  
  
  AddSubBlock(String, MySlimBlock)
  
  
  Declaration
  
    protected void AddSubBlock(string dummyName, MySlimBlock subblock)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | dummyName |  | 
      
        | Sandbox.Game.Entities.Cube.MySlimBlock | subblock |  | 
    
  
  
  
  
  AddUpgradeValue(String, Single)
  
  
  Declaration
  
    public void AddUpgradeValue(string name, float defaultValue)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | name |  | 
      
        | System.Single | defaultValue |  | 
    
  
  
  
  
  CalcLocalMatrix(out Matrix, out String)
  
  
  Declaration
  
    public void CalcLocalMatrix(out Matrix localMatrix, out string currModel)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | Matrix | localMatrix |  | 
      
        | System.String | currModel |  | 
    
  
  
  
  
  CalculateCurrentModel(out Matrix)
  
  
  Declaration
  
    public virtual string CalculateCurrentModel(out Matrix orientation)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | Matrix | orientation |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
  
  
  CanContinueBuild()
  
  
  Declaration
  
    public bool CanContinueBuild()
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  ChangeBlockOwnerRequest(Int64, MyOwnershipShareModeEnum)
  
  
  Declaration
  
    public void ChangeBlockOwnerRequest(long playerId, MyOwnershipShareModeEnum shareMode)
   
  Parameters
  
  
  
  
  ChangeOwner(Int64, MyOwnershipShareModeEnum)
  
  
  Declaration
  
    public void ChangeOwner(long owner, MyOwnershipShareModeEnum shareMode)
   
  Parameters
  
  
  
  
  CheckEmissiveState(Boolean)
  
  
  Declaration
  
    public virtual void CheckEmissiveState(bool force = false)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Boolean | force |  | 
    
  
  
  
  
  CheckIsWorking()
  
  
  Declaration
  
    protected virtual bool CheckIsWorking()
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  Closing()
  
  
  Declaration
  
    protected override void Closing()
   
  Overrides
  
  
  
  
  CommitUpgradeValues()
  
  
  Declaration
  
    public void CommitUpgradeValues()
   
  
  
  
  Components_ComponentAdded(Type, IMyEntityComponentBase)
  
  
  Declaration
  
    protected override void Components_ComponentAdded(Type t, IMyEntityComponentBase c)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Type | t |  | 
      
        | VRage.Game.Components.Interfaces.IMyEntityComponentBase | c |  | 
    
  
  Overrides
  
  
  
  
  Components_ComponentRemoved(Type, IMyEntityComponentBase)
  
  
  Declaration
  
    protected override void Components_ComponentRemoved(Type t, IMyEntityComponentBase c)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Type | t |  | 
      
        | VRage.Game.Components.Interfaces.IMyEntityComponentBase | c |  | 
    
  
  Overrides
  
  
  
  
  ConnectionAllowed(ref Vector3I, ref Vector3I, MyCubeBlockDefinition)
  Returns true if this block can connect to another block (of the given type) in the given position.
This is called only if CheckConnectionAllowed == true.
If this method would return true for any position, set CheckConnectionAllowed to false to avoid
unnecessary overhead. It is the block's responsibility to call CubeGrid.UpdateBlockNeighbors every time the
conditions that are checked by this method change.
Declaration
  
    public virtual bool ConnectionAllowed(ref Vector3I otherBlockPos, ref Vector3I faceNormal, MyCubeBlockDefinition def)
   
  Parameters
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  ConnectionAllowed(ref Vector3I, ref Vector3I, ref Vector3I, MyCubeBlockDefinition)
  Whether connection is allowed to any of the positions between otherBlockMinPos and otherBlockMaxPos (both inclusive).
Default implementation calls ConnectionAllowed(ref Vector3I otherBlockPos, ref Vector3I faceNormal) in a for loop.
Override this in a subclass if this is not needed (for example, because all calls would return the same value for the same face)
Declaration
  
    public virtual bool ConnectionAllowed(ref Vector3I otherBlockMinPos, ref Vector3I otherBlockMaxPos, ref Vector3I faceNormal, MyCubeBlockDefinition def)
   
  Parameters
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  
  Return true when contact is valid
Declaration
  
    public virtual void ContactPointCallback(ref MyGridContactInfo value)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | Sandbox.Game.Entities.Cube.MyGridContactInfo | value |  | 
    
  
  
  
  
  CreateRenderer(MyPersistentEntityFlags2, Vector3, Object)
  
  
  Declaration
  
    public void CreateRenderer(MyPersistentEntityFlags2 persistentFlags, Vector3 colorMaskHsv, object modelStorage)
   
  Parameters
  
  
  
  
  DisableUpdates()
  
  
  Declaration
  
    public virtual void DisableUpdates()
   
  
  
  
  FriendlyWithBlock(MyCubeBlock)
  Whether the two blocks are friendly. This relation is base on their owners and is symmetrical
Declaration
  
    public bool FriendlyWithBlock(MyCubeBlock block)
   
  Parameters
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  GetBlockGridOffset(MyCubeBlockDefinition)
  Returns block offset in spawned grid.
Declaration
  
    public static Vector3 GetBlockGridOffset(MyCubeBlockDefinition blockDefinition)
   
  Parameters
  
  Returns
  
  
  
  
  GetComponent()
  
  
  Declaration
  
    public MyUpgradableBlockComponent GetComponent()
   
  Returns
  
  
  
  
  GetDefaultEmissiveParts(Byte)
  
  
  Declaration
  
    protected virtual string GetDefaultEmissiveParts(byte index)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Byte | index |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
  
  
  GetGeometryLocalBox()
  
  
  Declaration
  
    public virtual BoundingBox GetGeometryLocalBox()
   
  Returns
  
  
  
  
  GetInteractiveObject(UInt32)
  
  
  Declaration
  
    public IMyUseObject GetInteractiveObject(uint shapeKey)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.UInt32 | shapeKey |  | 
    
  
  Returns
  
  
  
  
  GetIntersectionWithLine(ref LineD, out Nullable<MyIntersectionResultLineTriangleEx>, IntersectionFlags)
  
  
  Declaration
  
    public override bool GetIntersectionWithLine(ref LineD line, out Nullable<MyIntersectionResultLineTriangleEx> t, IntersectionFlags flags)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | LineD | line |  | 
      
        | System.Nullable<VRage.Game.Models.MyIntersectionResultLineTriangleEx> | t |  | 
      
        | IntersectionFlags | flags |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  Overrides
  
  
  
  
  GetLocalMatrix(out Matrix)
  
  
  Declaration
  
    public void GetLocalMatrix(out Matrix localMatrix)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | Matrix | localMatrix |  | 
    
  
  
  
  
  GetMass()
  
  
  Declaration
  
    public virtual float GetMass()
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Single |  | 
    
  
  
  
  
  GetObjectBuilder(Boolean)
  
  
  Declaration
  
    public sealed override MyObjectBuilder_EntityBase GetObjectBuilder(bool copy = false)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Boolean | copy |  | 
    
  
  Returns
  
  Overrides
  
  
  
  
  GetObjectBuilderCubeBlock(Boolean)
  
  
  Declaration
  
    public virtual MyObjectBuilder_CubeBlock GetObjectBuilderCubeBlock(bool copy = false)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Boolean | copy |  | 
    
  
  Returns
  
  
  
  
  GetOwnerFactionTag()
  
  
  Declaration
  
    public string GetOwnerFactionTag()
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
  
  
  GetPlayerRelationToOwner()
  
  
  Declaration
  
    public MyRelationsBetweenPlayerAndBlock GetPlayerRelationToOwner()
   
  Returns
  
  
  
  
  GetSubBlocks()
  
  
  Declaration
  
    public DictionaryReader<string, MySlimBlock> GetSubBlocks()
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | DictionaryReader<System.String, Sandbox.Game.Entities.Cube.MySlimBlock> |  | 
    
  
  
  
  
  GetUserRelationToOwner(Int64, MyRelationsBetweenPlayerAndBlock)
  
  
  Declaration
  
    public MyRelationsBetweenPlayerAndBlock GetUserRelationToOwner(long identityId, MyRelationsBetweenPlayerAndBlock defaultNoUser)
   
  Parameters
  
  Returns
  
  
  
  
  HasUnparentedSubpart()
  
  
  Declaration
  
    protected bool HasUnparentedSubpart()
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  Init()
  
  
  Declaration
  
  
  
  
  Init(MyObjectBuilder_CubeBlock, MyCubeGrid)
  
  
  Declaration
  
    public virtual void Init(MyObjectBuilder_CubeBlock builder, MyCubeGrid cubeGrid)
   
  Parameters
  
  
  
  
  Init(MyObjectBuilder_CubeBlock, IMyCubeGrid)
  
  
  Declaration
  
    public void Init(MyObjectBuilder_CubeBlock builder, IMyCubeGrid cubeGrid)
   
  Parameters
  
  
  
  
  InitComponents()
  
  
  Declaration
  
    public override void InitComponents()
   
  Overrides
  
  
  
  
  OnAddedToScene(Object)
  
  
  Declaration
  
    public override void OnAddedToScene(object source)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Object | source |  | 
    
  
  Overrides
  
  
  
  
  OnBuildSuccess(Int64, Boolean)
  Method called when a block has been built (after adding to the grid).
This is called right after placing the block and it doesn't matter whether
it is fully built (creative mode) or is only construction site.
Note that it is not called for blocks which do not create FatBlock at that moment.
Declaration
  
    public virtual void OnBuildSuccess(long builtBy, bool instantBuild)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | builtBy |  | 
      
        | System.Boolean | instantBuild |  | 
    
  
  
  
  
  OnConstraintAdded(GridLinkTypeEnum, IMyEntity)
  Called by constraint owner
Declaration
  
    protected void OnConstraintAdded(GridLinkTypeEnum type, IMyEntity attachedEntity)
   
  Parameters
  
  
  
  
  OnConstraintRemoved(GridLinkTypeEnum, IMyEntity)
  Called by constraint owner
Declaration
  
    protected void OnConstraintRemoved(GridLinkTypeEnum type, IMyEntity detachedEntity)
   
  Parameters
  
  
  
  
  OnCubeGridChanged(MyCubeGrid)
  Notifies about grid change with old grid in parameter (new grid is available in property).
Declaration
  
    public virtual void OnCubeGridChanged(MyCubeGrid oldGrid)
   
  Parameters
  
  
  
  
  OnDestroy()
  Called when block is destroyed before being removed from grid
Declaration
  
    public virtual void OnDestroy()
   
  
  
  
  OnInventoryComponentAdded(MyInventoryBase)
  
  
  Declaration
  
    protected override void OnInventoryComponentAdded(MyInventoryBase inventory)
   
  Parameters
  
  Overrides
  
  
  
  
  OnInventoryComponentRemoved(MyInventoryBase)
  
  
  Declaration
  
    protected override void OnInventoryComponentRemoved(MyInventoryBase inventory)
   
  Parameters
  
  Overrides
  
  
  
  
  OnModelChange()
  Called when the model referred by the block is changed
Declaration
  
    public virtual void OnModelChange()
   
  
  
  
  OnOwnershipChanged()
  
  
  Declaration
  
    protected virtual void OnOwnershipChanged()
   
  
  
  
  OnRegisteredToGridSystems()
  Called at the end of registration from grid systems (after block has been registered).
Declaration
  
    public virtual void OnRegisteredToGridSystems()
   
  
  
  
  OnRemovedByCubeBuilder()
  Method called when user removes a cube block from grid. Useful when block
has to remove some other attached block (like motors).
Declaration
  
    public virtual void OnRemovedByCubeBuilder()
   
  
  
  
  OnRemovedFromScene(Object)
  
  
  Declaration
  
    public override void OnRemovedFromScene(object source)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Object | source |  | 
    
  
  Overrides
  
  
  
  
  OnSubBlockClosing(MySlimBlock)
  
  
  Declaration
  
    protected void OnSubBlockClosing(MySlimBlock subBlock)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | Sandbox.Game.Entities.Cube.MySlimBlock | subBlock |  | 
    
  
  
  
  
  OnTeleport()
  
  
  Declaration
  
    public virtual void OnTeleport()
   
  
  
  
  OnUnregisteredFromGridSystems()
  Called at the end of unregistration from grid systems (after block has been unregistered).
Declaration
  
    public virtual void OnUnregisteredFromGridSystems()
   
  
  
  
  ReceivedDamage(Single, MyStringHash, Int64, Int64, Boolean, Nullable<MyStringHash>)
  Block received damage from any source.
Declaration
  
    public virtual bool ReceivedDamage(float damage, MyStringHash damageType, long attackerId, long realHitEntityId, bool shouldDetonateAmmo = true, Nullable<MyStringHash> extraInfo = null)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Single | damage |  | 
      
        | MyStringHash | damageType |  | 
      
        | System.Int64 | attackerId |  | 
      
        | System.Int64 | realHitEntityId |  | 
      
        | System.Boolean | shouldDetonateAmmo |  | 
      
        | System.Nullable<MyStringHash> | extraInfo |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean | Returns true if damage should be inflicted upon the block normally. | 
    
  
  
  
  
  RefreshModels(String, String)
  
  
  Declaration
  
    public override void RefreshModels(string modelPath, string modelCollisionPath)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | modelPath |  | 
      
        | System.String | modelCollisionPath |  | 
    
  
  Overrides
  
  
  
  
  ReleaseInventory(MyInventory, Boolean)
  
  
  Declaration
  
    public void ReleaseInventory(MyInventory inventory, bool damageContent = false)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | MyInventory | inventory |  | 
      
        | System.Boolean | damageContent |  | 
    
  
  
  
  
  RemoveEffect(String, Int32)
  
  
  Declaration
  
    public int RemoveEffect(string effectName, int exception = -1)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | effectName |  | 
      
        | System.Int32 | exception |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Int32 |  | 
    
  
  
  
  
  RemoveSubBlock(String, Boolean)
  Removes subblock with the given name from the block.
Declaration
  
    protected bool RemoveSubBlock(string subBlockName, bool removeFromGrid = true)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | subBlockName |  | 
      
        | System.Boolean | removeFromGrid |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  SetDamageEffect(Boolean)
  
  
  Declaration
  
    public virtual void SetDamageEffect(bool show)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Boolean | show |  | 
    
  
  
  
  
  SetDamageEffectDelayed(Boolean)
  
  
  Declaration
  
    public void SetDamageEffectDelayed(bool show)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Boolean | show |  | 
    
  
  
  
  
  SetEffect(String, Boolean)
  
  
  Declaration
  
    public bool SetEffect(string effectName, bool stopPrevious = false)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | effectName |  | 
      
        | System.Boolean | stopPrevious |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  SetEffect(String, Single, Boolean, Boolean, Boolean)
  
  
  Declaration
  
    public bool SetEffect(string effectName, float parameter, bool stopPrevious = false, bool ignoreParameter = false, bool removeSameNameEffects = false)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | effectName |  | 
      
        | System.Single | parameter |  | 
      
        | System.Boolean | stopPrevious |  | 
      
        | System.Boolean | ignoreParameter |  | 
      
        | System.Boolean | removeSameNameEffects |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  SetEmissiveState(MyStringHash, UInt32, String)
  
  
  Declaration
  
    public bool SetEmissiveState(MyStringHash state, uint renderObjectId, string namedPart = null)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | MyStringHash | state |  | 
      
        | System.UInt32 | renderObjectId |  | 
      
        | System.String | namedPart |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  SetEmissiveStateDamaged()
  
  
  Declaration
  
    public virtual bool SetEmissiveStateDamaged()
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  SetEmissiveStateDisabled()
  
  
  Declaration
  
    public virtual bool SetEmissiveStateDisabled()
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  SetEmissiveStateWorking()
  
  
  Declaration
  
    public virtual bool SetEmissiveStateWorking()
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  StopDamageEffect(Boolean)
  
  
  Declaration
  
    public virtual void StopDamageEffect(bool stopSound = true)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Boolean | stopSound |  | 
    
  
  
  
  
  SubBlocksInitialized(Boolean)
  Function called when all subblocks have been initialized.
Declaration
  
    protected void SubBlocksInitialized(bool spawned)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Boolean | spawned | true if subblocks have been just spawned on server, otherwise false (load) | 
    
  
  
  
  
  TryGetSubBlock(String, out MySlimBlock)
  
  
  Declaration
  
    public bool TryGetSubBlock(string name, out MySlimBlock block)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | name |  | 
      
        | Sandbox.Game.Entities.Cube.MySlimBlock | block |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  UpdateBeforeSimulation()
  
  
  Declaration
  
    public override void UpdateBeforeSimulation()
   
  Overrides
  
  
  
  
  UpdateBeforeSimulation10()
  
  
  Declaration
  
    public override void UpdateBeforeSimulation10()
   
  Overrides
  
  
  
  
  UpdateEmissiveParts(UInt32, Single, Color, Color)
  
  
  Declaration
  
    public void UpdateEmissiveParts(uint renderObjectId, float emissivity, Color emissivePartColor, Color displayPartColor)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.UInt32 | renderObjectId |  | 
      
        | System.Single | emissivity |  | 
      
        | Color | emissivePartColor |  | 
      
        | Color | displayPartColor |  | 
    
  
  
  
  
  UpdateIsWorking()
  
  
  Declaration
  
    public void UpdateIsWorking()
   
  
  
  
  UpdateOnceBeforeFrame()
  
  
  Declaration
  
    public override void UpdateOnceBeforeFrame()
   
  Overrides
  
  
  
  
  UpdateSkin(Boolean)
  
  
  Declaration
  
    public bool UpdateSkin(bool force = false)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Boolean | force |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  UpdateVisual()
  
  
  Declaration
  
    public virtual void UpdateVisual()
   
  
  
  
  WorldPositionChanged(Object)
  
  
  Declaration
  
    protected virtual void WorldPositionChanged(object source)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Object | source |  | 
    
  
  Events
  
  
  
  CanContinueBuildCheck
  
  
  Declaration
  
    public event Func<bool> CanContinueBuildCheck
   
  Event Type
  
    
      
        | Type | Description | 
    
    
      
        | System.Func<System.Boolean> |  | 
    
  
  
  
  CheckConnectionChanged
  
  
  Declaration
  
    public event Action<MyCubeBlock> CheckConnectionChanged
   
  Event Type
  
  
  
  CubeGridChanged
  
  
  Declaration
  
    public event Action<IMyCubeGrid> CubeGridChanged
   
  Event Type
  
  
  
  GetEmissiveStateHashFromComponent
  
  
  Declaration
  
    public event Func<Nullable<MyStringHash>> GetEmissiveStateHashFromComponent
   
  Event Type
  
  
  
  GetIsWorking
  
  
  Declaration
  
    public event Func<bool> GetIsWorking
   
  Event Type
  
    
      
        | Type | Description | 
    
    
      
        | System.Func<System.Boolean> |  | 
    
  
  
  
  IsWorkingChanged
  
  
  Declaration
  
    public event Action<MyCubeBlock> IsWorkingChanged
   
  Event Type
  
  
  
  OnBlockDisableUpdates
  
  
  Declaration
  
    public event Action<MyCubeBlock> OnBlockDisableUpdates
   
  Event Type
  
  
  
  OnBlockModelChange
  
  
  Declaration
  
    public event Action<MyCubeBlock> OnBlockModelChange
   
  Event Type
  
  
  
  OnBlockRegisteredToGridSystems
  
  
  Declaration
  
    public event Action<MyCubeBlock> OnBlockRegisteredToGridSystems
   
  Event Type
  
  
  
  OnBlockUpdateVisual
  
  
  Declaration
  
    public event Action<MyCubeBlock> OnBlockUpdateVisual
   
  Event Type
  
  
  
  OnUpdateBeforenextFrame
  
  
  Declaration
  
    public event Action OnUpdateBeforenextFrame
   
  Event Type
  
    
      
        | Type | Description | 
    
    
      
        | System.Action |  | 
    
  
  
  
  OnUpgradeValuesChanged
  
  
  Declaration
  
    public event Action OnUpgradeValuesChanged
   
  Event Type
  
    
      
        | Type | Description | 
    
    
      
        | System.Action |  | 
    
  
  Explicit Interface Implementations
  
  
  
  
  IMyUpgradableBlock.FillUpgradesDictionary(Dictionary<String, Single>)
  
  
  Declaration
  
    void IMyUpgradableBlock.FillUpgradesDictionary(Dictionary<string, float> upgrades)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Collections.Generic.Dictionary<System.String, System.Single> | upgrades |  | 
    
  
  
  
  
  IMyUpgradableBlock.GetUpgrades(out Dictionary<String, Single>)
  
  
  Declaration
  
    void IMyUpgradableBlock.GetUpgrades(out Dictionary<string, float> upgrades)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Collections.Generic.Dictionary<System.String, System.Single> | upgrades |  | 
    
  
  
  
  
  IMyUpgradableBlock.UpgradeCount
  
  
  Declaration
  
    uint IMyUpgradableBlock.UpgradeCount { get; }
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.UInt32 |  | 
    
  
  
  
  
  IMyComponentOwner<MyIDModule>.GetComponent(out MyIDModule)
  
  
  Declaration
  
    bool IMyComponentOwner<MyIDModule>.GetComponent(out MyIDModule component)
   
  Parameters
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IMyCubeBlock.CalcLocalMatrix(out Matrix, out String)
  
  
  Declaration
  
    void IMyCubeBlock.CalcLocalMatrix(out Matrix localMatrix, out string currModel)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | Matrix | localMatrix |  | 
      
        | System.String | currModel |  | 
    
  
  
  
  
  IMyCubeBlock.CalculateCurrentModel(out Matrix)
  
  
  Declaration
  
    string IMyCubeBlock.CalculateCurrentModel(out Matrix orientation)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | Matrix | orientation |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
  
  
  IMyCubeBlock.CheckConnectionAllowed
  
  
  Declaration
  
    bool IMyCubeBlock.CheckConnectionAllowed { get; set; }
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IMyCubeBlock.CubeGrid
  
  
  Declaration
  
    IMyCubeGrid IMyCubeBlock.CubeGrid { get; }
   
  Returns
  
  
  
  
  IMyCubeBlock.GetObjectBuilderCubeBlock(Boolean)
  
  
  Declaration
  
    MyObjectBuilder_CubeBlock IMyCubeBlock.GetObjectBuilderCubeBlock(bool copy)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Boolean | copy |  | 
    
  
  Returns
  
  
  
  
  IMyCubeBlock.Init()
  
  
  Declaration
  
  
  
  
  IMyCubeBlock.Init(MyObjectBuilder_CubeBlock, IMyCubeGrid)
  
  
  Declaration
  
    void IMyCubeBlock.Init(MyObjectBuilder_CubeBlock builder, IMyCubeGrid cubeGrid)
   
  Parameters
  
  
  
  IMyCubeBlock.IsWorkingChanged
  
  
  Declaration
  
    event Action<IMyCubeBlock> IMyCubeBlock.IsWorkingChanged
   
  Returns
  
  
  
  
  IMyCubeBlock.OnBuildSuccess(Int64)
  
  
  Declaration
  
    void IMyCubeBlock.OnBuildSuccess(long builtBy)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | builtBy |  | 
    
  
  
  
  
  IMyCubeBlock.OnBuildSuccess(Int64, Boolean)
  
  
  Declaration
  
    void IMyCubeBlock.OnBuildSuccess(long builtBy, bool instantBuild)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Int64 | builtBy |  | 
      
        | System.Boolean | instantBuild |  | 
    
  
  
  
  
  IMyCubeBlock.OnDestroy()
  
  
  Declaration
  
    void IMyCubeBlock.OnDestroy()
   
  
  
  
  IMyCubeBlock.OnModelChange()
  
  
  Declaration
  
    void IMyCubeBlock.OnModelChange()
   
  
  
  
  IMyCubeBlock.OnRegisteredToGridSystems()
  
  
  Declaration
  
    void IMyCubeBlock.OnRegisteredToGridSystems()
   
  
  
  
  IMyCubeBlock.OnRemovedByCubeBuilder()
  
  
  Declaration
  
    void IMyCubeBlock.OnRemovedByCubeBuilder()
   
  
  
  
  IMyCubeBlock.OnUnregisteredFromGridSystems()
  
  
  Declaration
  
    void IMyCubeBlock.OnUnregisteredFromGridSystems()
   
  
  
  
  IMyCubeBlock.RaycastDetectors(Vector3D, Vector3D)
  
  
  Declaration
  
    string IMyCubeBlock.RaycastDetectors(Vector3D worldFrom, Vector3D worldTo)
   
  Parameters
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.String |  | 
    
  
  
  
  
  IMyCubeBlock.ReloadDetectors(Boolean)
  
  
  Declaration
  
    void IMyCubeBlock.ReloadDetectors(bool refreshNetworks)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Boolean | refreshNetworks |  | 
    
  
  
  
  
  IMyCubeBlock.RemoveEffect(String, Int32)
  
  
  Declaration
  
    int IMyCubeBlock.RemoveEffect(string effectName, int exception)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | effectName |  | 
      
        | System.Int32 | exception |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Int32 |  | 
    
  
  
  
  
  IMyCubeBlock.ResourceSink
  
  
  Declaration
  
    MyResourceSinkComponentBase IMyCubeBlock.ResourceSink { get; set; }
   
  Returns
  
  
  
  
  IMyCubeBlock.SetDamageEffect(Boolean)
  
  
  Declaration
  
    void IMyCubeBlock.SetDamageEffect(bool start)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.Boolean | start |  | 
    
  
  
  
  
  IMyCubeBlock.SetEffect(String, Boolean)
  
  
  Declaration
  
    bool IMyCubeBlock.SetEffect(string effectName, bool stopPrevious)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | effectName |  | 
      
        | System.Boolean | stopPrevious |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IMyCubeBlock.SetEffect(String, Single, Boolean, Boolean, Boolean)
  
  
  Declaration
  
    bool IMyCubeBlock.SetEffect(string effectName, float parameter, bool stopPrevious, bool ignoreParameter, bool removeSameNameEffects)
   
  Parameters
  
    
      
        | Type | Name | Description | 
    
    
      
        | System.String | effectName |  | 
      
        | System.Single | parameter |  | 
      
        | System.Boolean | stopPrevious |  | 
      
        | System.Boolean | ignoreParameter |  | 
      
        | System.Boolean | removeSameNameEffects |  | 
    
  
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Boolean |  | 
    
  
  
  
  
  IMyCubeBlock.SlimBlock
  
  
  Declaration
  
    IMySlimBlock IMyCubeBlock.SlimBlock { get; }
   
  Returns
  
  
  
  
  IMyCubeBlock.BlockDefinition
  
  
  Declaration
  
    SerializableDefinitionId IMyCubeBlock.BlockDefinition { get; }
   
  Returns
  
  
  
  
  IMyCubeBlock.CubeGrid
  
  
  Declaration
  
    IMyCubeGrid IMyCubeBlock.CubeGrid { get; }
   
  Returns
  
  
  
  
  IMyCubeBlock.GetPlayerRelationToOwner()
  
  
  Declaration
  
    MyRelationsBetweenPlayerAndBlock IMyCubeBlock.GetPlayerRelationToOwner()
   
  Returns
  
  
  
  
  IMyCubeBlock.GetUserRelationToOwner(Int64, MyRelationsBetweenPlayerAndBlock)
  
  
  Declaration
  
    MyRelationsBetweenPlayerAndBlock IMyCubeBlock.GetUserRelationToOwner(long playerId, MyRelationsBetweenPlayerAndBlock defaultNoUser)
   
  Parameters
  
  Returns
  
  
  
  
  IMyCubeBlock.Mass
  
  
  Declaration
  
    float IMyCubeBlock.Mass { get; }
   
  Returns
  
    
      
        | Type | Description | 
    
    
      
        | System.Single |  | 
    
  
  
  
  
  IMyCubeBlock.UpdateIsWorking()
  
  
  Declaration
  
    void IMyCubeBlock.UpdateIsWorking()
   
  
  
  
  IMyCubeBlock.UpdateVisual()
  
  
  Declaration
  
    void IMyCubeBlock.UpdateVisual()
   
  Implements
  
  
  
  
  
  
  
  Extension Methods