Show / Hide Table of Contents

Class MyCubeBlock

Inheritance
System.Object
MyEntity
MyCubeBlock
MyCompoundCubeBlock
MyConveyor
MyConveyorConnector
MyEmissiveBlock
MyKitchen
MyPlanter
Implements
IMyComponentOwner<MyIDModule>
IMyUpgradableBlock
IMyCubeBlock
IMyEntity
IMyUpgradableBlock
IMyCubeBlock
IMyEntity
Inherited Members
MyEntity.m_contactPoint
MyEntity.DefinitionId
MyEntity.DebugAsyncLoading
MyEntity.m_hudParams
MyEntity.m_positionResetFromServer
MyEntity.m_modelCollision
MyEntity.GamePruningProxyId
MyEntity.TopMostPruningProxyId
MyEntity.StaticForPruningStructure
MyEntity.TargetPruningProxyId
MyEntity.IsPreviewChanged
MyEntity.ReadyForReplicationAction
MyEntity.PropagateSubpartRotationThroughHieerarchy
MyEntity.ReplicationStarted
MyEntity.ReplicationEnded
MyEntity.OnEntityCloseRequest
MyEntity.InstantiateSubpartOverrideFunc
MyEntity.AddToGamePruningStructureExtCallBack
MyEntity.RemoveFromGamePruningStructureExtCallBack
MyEntity.UpdateGamePruningStructureExtCallBack
MyEntity.MyEntityFactoryCreateObjectBuilderExtCallback
MyEntity.CreateDefaultSyncEntityExtCallback
MyEntity.MyWeldingGroupsAddNodeExtCallback
MyEntity.MyWeldingGroupsRemoveNodeExtCallback
MyEntity.MyWeldingGroupsGetGroupNodesExtCallback
MyEntity.MyWeldingGroupsGroupExistsExtCallback
MyEntity.MyProceduralWorldGeneratorTrackEntityExtCallback
MyEntity.CreateStandardRenderComponentsExtCallback
MyEntity.InitComponentsExtCallback
MyEntity.MyEntitiesCreateFromObjectBuilderExtCallback
MyEntity.DebugDraw()
MyEntity.DebugDrawInvalidTriangles()
MyEntity.AddDebugRenderComponent(MyDebugRenderComponentBase)
MyEntity.ContainsDebugRenderComponent(Type)
MyEntity.TryGetDebugRenderComponent<T>(T)
MyEntity.RemoveDebugRenderComponent(Type)
MyEntity.RemoveDebugRenderComponent(MyDebugRenderComponentBase)
MyEntity.ClearDebugRenderComponents()
MyEntity.GetTopMostParent(Type)
MyEntity.GetHudParams(Boolean)
MyEntity.CanBeAddedToRender()
MyEntity.InitComponentsForTesting()
MyEntity.OnCreateSync()
MyEntity.CreateSync()
MyEntity.GetSubpart(String)
MyEntity.TryGetSubpart(String, MyEntitySubpart)
MyEntity.Simulate()
MyEntity.UpdateAfterSimulation()
MyEntity.UpdatingStopped()
MyEntity.UpdateAfterSimulation10()
MyEntity.UpdateBeforeSimulation100()
MyEntity.UpdateAfterSimulation100()
MyEntity.GetFriendlyName()
MyEntity.GetViewMatrix()
MyEntity.Teleport(MatrixD, Object, Boolean)
MyEntity.DebugDrawPhysics()
MyEntity.GetIntersectionWithLine(LineD, Nullable<Vector3D>, Boolean, IntersectionFlags)
MyEntity.GetIntersectionWithLineAndBoundingSphere(LineD, Single)
MyEntity.GetIntersectionWithSphere(BoundingSphereD)
MyEntity.GetIntersectionWithAABB(BoundingBoxD)
MyEntity.GetTrianglesIntersectingSphere(BoundingSphere, Nullable<Vector3>, Nullable<Single>, List<MyTriangle_Vertex_Normals>, Int32)
MyEntity.DoOverlapSphereTest(Single, Vector3D)
MyEntity.GetSmallestDistanceBetweenCameraAndBoundingSphere()
MyEntity.GetLargestDistanceBetweenCameraAndBoundingSphere()
MyEntity.GetDistanceBetweenCameraAndBoundingSphere()
MyEntity.GetDistanceBetweenPlayerPositionAndBoundingSphere()
MyEntity.GetDistanceBetweenCameraAndPosition()
MyEntity.GetBaseEntity()
MyEntity.OnReplicationStarted()
MyEntity.OnReplicationEnded()
MyEntity.SetFadeOut(Boolean)
MyEntity.AddToGamePruningStructure()
MyEntity.RemoveFromGamePruningStructure()
MyEntity.UpdateGamePruningStructure()
MyEntity.RaisePhysicsChanged()
MyEntity.Init(MyObjectBuilder_EntityBase)
MyEntity.BeforeGameLogicInit()
MyEntity.ClampToWorld()
MyEntity.Init(StringBuilder, String, MyEntity, Nullable<Single>, String)
MyEntity.Delete()
MyEntity.BeforeDelete()
MyEntity.Close()
MyEntity.BeforeSave()
MyEntity.PrepareForDraw()
MyEntity.BeforePaste()
MyEntity.AfterPaste()
MyEntity.SetEmissiveParts(String, Color, Single)
MyEntity.SetEmissivePartsForSubparts(String, Color, Single)
MyEntity.UpdateNamedEmissiveParts(UInt32, String, Color, Single)
MyEntity.InstantiateSubpart(MyModelDummy, MyEntitySubpart.Data)
MyEntity.GetCubeBlockParent(MyEntity)
MyEntity.ToString()
MyEntity.GetInventoryBase(Int32)
MyEntity.GetInventoryBase()
MyEntity.SerializeControls(BitStream)
MyEntity.DeserializeControls(BitStream, Boolean)
MyEntity.ApplyLastControls()
MyEntity.ResetControls()
MyEntity.Pin()
MyEntity.Unpin()
MyEntity.UpdateSoundContactPoint(Int64, Vector3, Vector3, Vector3, Single)
MyEntity.IMyEntity.GetTopMostParent(Type)
MyEntity.IMyEntity.GetChildren(List<IMyEntity>, Func<IMyEntity, Boolean>)
MyEntity.IMyEntity.GetFriendlyName()
MyEntity.IMyEntity.Close()
MyEntity.IMyEntity.Delete()
MyEntity.IMyEntity.GetDiffuseColor()
MyEntity.IMyEntity.GetDistanceBetweenCameraAndBoundingSphere()
MyEntity.IMyEntity.GetDistanceBetweenCameraAndPosition()
MyEntity.IMyEntity.GetLargestDistanceBetweenCameraAndBoundingSphere()
MyEntity.IMyEntity.GetSmallestDistanceBetweenCameraAndBoundingSphere()
MyEntity.IMyEntity.GetIntersectionWithLineAndBoundingSphere(LineD, Single)
MyEntity.IMyEntity.GetIntersectionWithSphere(BoundingSphereD)
MyEntity.IMyEntity.GetInventory()
MyEntity.IMyEntity.GetInventory(Int32)
MyEntity.IMyEntity.GetTrianglesIntersectingSphere(BoundingSphere, Nullable<Vector3>, Nullable<Single>, List<MyTriangle_Vertex_Normals>, Int32)
MyEntity.IMyEntity.DoOverlapSphereTest(Single, Vector3D)
MyEntity.IMyEntity.GetObjectBuilder(Boolean)
MyEntity.IMyEntity.IsVisible()
MyEntity.IMyEntity.GetViewMatrix()
MyEntity.IMyEntity.GetWorldMatrixNormalizedInv()
MyEntity.IMyEntity.SetLocalMatrix(Matrix, Object)
MyEntity.IMyEntity.SetWorldMatrix(MatrixD, Object)
MyEntity.IMyEntity.SetPosition(Vector3D)
MyEntity.IMyEntity.EnableColorMaskForSubparts(Boolean)
MyEntity.IMyEntity.SetColorMaskForSubparts(Vector3)
MyEntity.IMyEntity.SetTextureChangesForSubparts(Dictionary<String, MyTextureChange>)
MyEntity.IMyEntity.SetTextureChangesForSubparts(Dictionary<MyStringId, MyTextureChange>)
MyEntity.IMyEntity.SetEmissiveParts(String, Color, Single)
MyEntity.IMyEntity.SetEmissivePartsForSubparts(String, Color, Single)
MyEntity.IMyEntity.GetInventory()
MyEntity.IMyEntity.GetInventory(Int32)
MyEntity.IMyEntity.GetPosition()
MyEntity.Components
MyEntity.Name
MyEntity.PositionComp
MyEntity.Render
MyEntity.GameLogic
MyEntity.EntityId
MyEntity.SyncObject
MyEntity.Storage
MyEntity.EntityStorage
MyEntity.Closed
MyEntity.MarkedForClose
MyEntity.MaxGlassDistSq
MyEntity.Save
MyEntity.IsPreview
MyEntity.IsReadyForReplication
MyEntity.NeedsUpdate
MyEntity.WorldMatrix
MyEntity.Parent
MyEntity.Hierarchy
MyEntity.IMyEntity.Hierarchy
MyEntity.IMyEntity.Physics
MyEntity.InvalidateOnMove
MyEntity.SyncFlag
MyEntity.NeedsWorldMatrix
MyEntity.InScene
MyEntity.IsVolumetric
MyEntity.LocationForHudMarker
MyEntity.Model
MyEntity.ModelCollision
MyEntity.DisplayName
MyEntity.DebugName
MyEntity.Subparts
MyEntity.IsCCDForProjectiles
MyEntity.Pinned
MyEntity.UpdateDuration
MyEntity.IsReplicated
MyEntity.InventoryCount
MyEntity.HasInventory
MyEntity.DisplayNameText
MyEntity.LastSnapshotFlags
MyEntity.Flags
MyEntity.IMyEntity.Parent
MyEntity.IMyEntity.Name
MyEntity.IMyEntity.DebugAsyncLoading
MyEntity.IMyEntity.DisplayName
MyEntity.IMyEntity.MarkedForClose
MyEntity.IMyEntity.Closed
MyEntity.IMyEntity.Model
MyEntity.IMyEntity.GameLogic
MyEntity.IMyEntity.NeedsUpdate
MyEntity.IMyEntity.NearFlag
MyEntity.IMyEntity.CastShadows
MyEntity.IMyEntity.FastCastShadowResolve
MyEntity.IMyEntity.NeedsResolveCastShadow
MyEntity.IMyEntity.MaxGlassDistSq
MyEntity.IMyEntity.NeedsDraw
MyEntity.IMyEntity.NeedsDrawFromParent
MyEntity.IMyEntity.Transparent
MyEntity.IMyEntity.ShadowBoxLod
MyEntity.IMyEntity.SkipIfTooSmall
MyEntity.IMyEntity.Storage
MyEntity.IMyEntity.Visible
MyEntity.IMyEntity.Save
MyEntity.IMyEntity.PersistentFlags
MyEntity.IMyEntity.InScene
MyEntity.IMyEntity.InvalidateOnMove
MyEntity.IMyEntity.IsCCDForProjectiles
MyEntity.IMyEntity.IsVolumetric
MyEntity.IMyEntity.LocalAABB
MyEntity.IMyEntity.LocalAABBHr
MyEntity.IMyEntity.LocalMatrix
MyEntity.IMyEntity.LocalVolume
MyEntity.IMyEntity.LocalVolumeOffset
MyEntity.IMyEntity.LocationForHudMarker
MyEntity.IMyEntity.Synchronized
MyEntity.IMyEntity.WorldMatrix
MyEntity.IMyEntity.WorldMatrixInvScaled
MyEntity.IMyEntity.WorldMatrixNormalizedInv
MyEntity.IMyEntity.ModelCollision
MyEntity.IMyEntity.HasInventory
MyEntity.IMyEntity.InventoryCount
MyEntity.IMyEntity.DisplayName
MyEntity.IMyEntity.Name
MyEntity.IMyEntity.WorldAABB
MyEntity.IMyEntity.WorldAABBHr
MyEntity.IMyEntity.WorldMatrix
MyEntity.IMyEntity.WorldVolume
MyEntity.IMyEntity.WorldVolumeHr
MyEntity.StopPhysicsActivation
MyEntity.OnMarkForClose
MyEntity.OnClose
MyEntity.OnClosing
MyEntity.OnModelRefresh
MyEntity.OnUpdateOnceBeforeNextFrame
MyEntity.OnDebugDraw
MyEntity.OnPhysicsChanged
MyEntity.OnPhysicsComponentChanged
MyEntity.AddedToScene
MyEntity.RemovedFromScene
MyEntity.OnTeleported
MyEntity.IMyEntity.OnClose
MyEntity.IMyEntity.OnClosing
MyEntity.IMyEntity.OnMarkForClose
MyEntity.IMyEntity.OnPhysicsChanged
Namespace: Sandbox.Game.Entities
Assembly: Sandbox.Game.dll
Syntax
public class MyCubeBlock : MyEntity, IMyComponentOwner<MyIDModule>, IMyUpgradableBlock, IMyCubeBlock, IMyEntity, IMyUpgradableBlock, IMyCubeBlock, IMyEntity

Constructors

MyCubeBlock()

Declaration
public MyCubeBlock()

Fields

CurrentAttachedUpgradeModules

Declaration
public Dictionary<long, MyCubeBlock.AttachedUpgradeModule> CurrentAttachedUpgradeModules
Field Value
Type Description
System.Collections.Generic.Dictionary<System.Int64, MyCubeBlock.AttachedUpgradeModule>

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
public bool IsSilenced
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
Type Description
MyCubeBlock.EmissiveNames

m_forceBlockDestructible

Declaration
protected bool m_forceBlockDestructible
Field Value
Type Description
System.Boolean

m_soundEmitter

Declaration
public MyEntity3DSoundEmitter m_soundEmitter
Field Value
Type Description
MyEntity3DSoundEmitter

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
Type Description
MyCubeBlockDefinition

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
Type Description
MyCubeGrid

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
Type Description
MyCubeBlockHighlightModes

IDModule

Declaration
public MyIDModule IDModule { get; }
Property Value
Type Description
MyIDModule

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

Shortcut to component stack property.

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
Type Description
Vector3I

Min

Declaration
public Vector3I Min { get; }
Property Value
Type Description
Vector3I

NumberInGrid

Declaration
public int NumberInGrid { get; set; }
Property Value
Type Description
System.Int32

Orientation

Declaration
public MyBlockOrientation Orientation { get; }
Property Value
Type Description
MyBlockOrientation

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
Type Description
Vector3I

ResourceSink

Declaration
public MyResourceSinkComponent ResourceSink { get; set; }
Property Value
Type Description
MyResourceSinkComponent

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
Type Description
MyUseObjectsComponentBase

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

AllSubBlocksInitialized()

Declaration
protected bool AllSubBlocksInitialized()
Returns
Type Description
System.Boolean

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
Type Name Description
System.Int64 playerId
MyOwnershipShareModeEnum shareMode

ChangeOwner(Int64, MyOwnershipShareModeEnum)

Declaration
public void ChangeOwner(long owner, MyOwnershipShareModeEnum shareMode)
Parameters
Type Name Description
System.Int64 owner
MyOwnershipShareModeEnum shareMode

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
MyEntity.Closing()

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
MyEntity.Components_ComponentAdded(Type, IMyEntityComponentBase)

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
MyEntity.Components_ComponentRemoved(Type, IMyEntityComponentBase)

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
Type Name Description
Vector3I otherBlockPos
Vector3I faceNormal
MyCubeBlockDefinition def
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
Type Name Description
Vector3I otherBlockMinPos
Vector3I otherBlockMaxPos
Vector3I faceNormal
MyCubeBlockDefinition def
Returns
Type Description
System.Boolean

ContactPointCallback(ref MyGridContactInfo)

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
Type Name Description
MyPersistentEntityFlags2 persistentFlags
Vector3 colorMaskHsv
System.Object modelStorage

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
Type Name Description
MyCubeBlock block
Returns
Type Description
System.Boolean

GetBlockGridOffset(MyCubeBlockDefinition)

Returns block offset in spawned grid.

Declaration
public static Vector3 GetBlockGridOffset(MyCubeBlockDefinition blockDefinition)
Parameters
Type Name Description
MyCubeBlockDefinition blockDefinition
Returns
Type Description
Vector3

GetComponent()

Declaration
public MyUpgradableBlockComponent GetComponent()
Returns
Type Description
MyUpgradableBlockComponent

GetDefaultEmissiveParts(Byte)

Declaration
protected virtual string GetDefaultEmissiveParts(byte index)
Parameters
Type Name Description
System.Byte index
Returns
Type Description
System.String

GetFractureComponent()

Declaration
public MyFractureComponentCubeBlock GetFractureComponent()
Returns
Type Description
MyFractureComponentCubeBlock

GetGeometryLocalBox()

Declaration
public virtual BoundingBox GetGeometryLocalBox()
Returns
Type Description
BoundingBox

GetInteractiveObject(UInt32)

Declaration
public IMyUseObject GetInteractiveObject(uint shapeKey)
Parameters
Type Name Description
System.UInt32 shapeKey
Returns
Type Description
IMyUseObject

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
MyEntity.GetIntersectionWithLine(ref LineD, out Nullable<MyIntersectionResultLineTriangleEx>, IntersectionFlags)

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
Type Description
MyObjectBuilder_EntityBase
Overrides
MyEntity.GetObjectBuilder(Boolean)

GetObjectBuilderCubeBlock(Boolean)

Declaration
public virtual MyObjectBuilder_CubeBlock GetObjectBuilderCubeBlock(bool copy = false)
Parameters
Type Name Description
System.Boolean copy
Returns
Type Description
MyObjectBuilder_CubeBlock

GetOwnerFactionTag()

Declaration
public string GetOwnerFactionTag()
Returns
Type Description
System.String

GetPlayerRelationToOwner()

Declaration
public MyRelationsBetweenPlayerAndBlock GetPlayerRelationToOwner()
Returns
Type Description
MyRelationsBetweenPlayerAndBlock

GetSubBlockDataFromDummy(MyCubeBlockDefinition, String, MyModelDummy, Boolean, out MyCubeBlockDefinition, out MatrixD, out Vector3)

Returns subblock data from dummy, subblock matrix can be offset (according to useOffset parameter) so the dummy position output is also provided.

Declaration
public static bool GetSubBlockDataFromDummy(MyCubeBlockDefinition ownerBlockDefinition, string dummyName, MyModelDummy dummy, bool useOffset, out MyCubeBlockDefinition subBlockDefinition, out MatrixD subBlockMatrix, out Vector3 dummyPosition)
Parameters
Type Name Description
MyCubeBlockDefinition ownerBlockDefinition
System.String dummyName
VRageRender.Import.MyModelDummy dummy
System.Boolean useOffset
MyCubeBlockDefinition subBlockDefinition
MatrixD subBlockMatrix
Vector3 dummyPosition
Returns
Type Description
System.Boolean

true when dummy is subblock otherwise false

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
Type Name Description
System.Int64 identityId
MyRelationsBetweenPlayerAndBlock defaultNoUser
Returns
Type Description
MyRelationsBetweenPlayerAndBlock

HasUnparentedSubpart()

Declaration
protected bool HasUnparentedSubpart()
Returns
Type Description
System.Boolean

Init()

Declaration
public void Init()

Init(MyObjectBuilder_CubeBlock, MyCubeGrid)

Declaration
public virtual void Init(MyObjectBuilder_CubeBlock builder, MyCubeGrid cubeGrid)
Parameters
Type Name Description
MyObjectBuilder_CubeBlock builder
MyCubeGrid cubeGrid

Init(MyObjectBuilder_CubeBlock, IMyCubeGrid)

Declaration
public void Init(MyObjectBuilder_CubeBlock builder, IMyCubeGrid cubeGrid)
Parameters
Type Name Description
MyObjectBuilder_CubeBlock builder
IMyCubeGrid cubeGrid

InitComponents()

Declaration
public override void InitComponents()
Overrides
MyEntity.InitComponents()

OnAddedToScene(Object)

Declaration
public override void OnAddedToScene(object source)
Parameters
Type Name Description
System.Object source
Overrides
MyEntity.OnAddedToScene(Object)

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
Type Name Description
GridLinkTypeEnum type
IMyEntity attachedEntity

OnConstraintRemoved(GridLinkTypeEnum, IMyEntity)

Called by constraint owner

Declaration
protected void OnConstraintRemoved(GridLinkTypeEnum type, IMyEntity detachedEntity)
Parameters
Type Name Description
GridLinkTypeEnum type
IMyEntity detachedEntity

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
Type Name Description
MyCubeGrid oldGrid

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
Type Name Description
MyInventoryBase inventory
Overrides
MyEntity.OnInventoryComponentAdded(MyInventoryBase)

OnInventoryComponentRemoved(MyInventoryBase)

Declaration
protected override void OnInventoryComponentRemoved(MyInventoryBase inventory)
Parameters
Type Name Description
MyInventoryBase inventory
Overrides
MyEntity.OnInventoryComponentRemoved(MyInventoryBase)

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
MyEntity.OnRemovedFromScene(Object)

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
MyEntity.RefreshModels(String, String)

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
MyEntity.UpdateBeforeSimulation()

UpdateBeforeSimulation10()

Declaration
public override void UpdateBeforeSimulation10()
Overrides
MyEntity.UpdateBeforeSimulation10()

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
MyEntity.UpdateOnceBeforeFrame()

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
Type Description
System.Action<MyCubeBlock>

CubeGridChanged

Declaration
public event Action<IMyCubeGrid> CubeGridChanged
Event Type
Type Description
System.Action<IMyCubeGrid>

GetEmissiveStateHashFromComponent

Declaration
public event Func<Nullable<MyStringHash>> GetEmissiveStateHashFromComponent
Event Type
Type Description
System.Func<System.Nullable<MyStringHash>>

IsWorkingChanged

Declaration
public event Action<MyCubeBlock> IsWorkingChanged
Event Type
Type Description
System.Action<MyCubeBlock>

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.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
Type Name Description
MyIDModule component
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
Type Description
IMyCubeGrid

IMyCubeBlock.GetObjectBuilderCubeBlock(Boolean)

Declaration
MyObjectBuilder_CubeBlock IMyCubeBlock.GetObjectBuilderCubeBlock(bool copy)
Parameters
Type Name Description
System.Boolean copy
Returns
Type Description
MyObjectBuilder_CubeBlock

IMyCubeBlock.Init()

Declaration
void IMyCubeBlock.Init()

IMyCubeBlock.Init(MyObjectBuilder_CubeBlock, IMyCubeGrid)

Declaration
void IMyCubeBlock.Init(MyObjectBuilder_CubeBlock builder, IMyCubeGrid cubeGrid)
Parameters
Type Name Description
MyObjectBuilder_CubeBlock builder
IMyCubeGrid cubeGrid

IMyCubeBlock.IsWorkingChanged

Declaration
event Action<IMyCubeBlock> IMyCubeBlock.IsWorkingChanged
Returns
Type Description
System.Action<IMyCubeBlock>

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
Type Name Description
Vector3D worldFrom
Vector3D worldTo
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
Type Description
MyResourceSinkComponentBase

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
Type Description
IMySlimBlock

IMyCubeBlock.BlockDefinition

Declaration
SerializableDefinitionId IMyCubeBlock.BlockDefinition { get; }
Returns
Type Description
SerializableDefinitionId

IMyCubeBlock.CubeGrid

Declaration
IMyCubeGrid IMyCubeBlock.CubeGrid { get; }
Returns
Type Description
IMyCubeGrid

IMyCubeBlock.GetPlayerRelationToOwner()

Declaration
MyRelationsBetweenPlayerAndBlock IMyCubeBlock.GetPlayerRelationToOwner()
Returns
Type Description
MyRelationsBetweenPlayerAndBlock

IMyCubeBlock.GetUserRelationToOwner(Int64, MyRelationsBetweenPlayerAndBlock)

Declaration
MyRelationsBetweenPlayerAndBlock IMyCubeBlock.GetUserRelationToOwner(long playerId, MyRelationsBetweenPlayerAndBlock defaultNoUser)
Parameters
Type Name Description
System.Int64 playerId
MyRelationsBetweenPlayerAndBlock defaultNoUser
Returns
Type Description
MyRelationsBetweenPlayerAndBlock

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

IMyComponentOwner<T>
IMyUpgradableBlock
IMyCubeBlock
IMyEntity
IMyUpgradableBlock
IMyCubeBlock
IMyEntity

Extension Methods

MyEntityInventoryOwnerExtensions.InventoryOwnerType(MyEntity)
MyEntityExtensions.GetPhysicsBody(MyEntity)
MyEntityExtensions.UpdateGamePruningStructure(MyEntity)
MyEntityExtensions.AddToGamePruningStructure(MyEntity)
MyEntityExtensions.RemoveFromGamePruningStructure(MyEntity)
MyEntityExtensions.EntityFactoryCreateObjectBuilder(MyEntity)
MyEntityExtensions.CreateDefaultSyncEntity(MyEntity)
MyEntityExtensions.AddNodeToWeldingGroups(MyEntity)
MyEntityExtensions.RemoveNodeFromWeldingGroups(MyEntity)
MyEntityExtensions.GetWeldingGroupNodes(MyEntity, List<MyEntity>)
MyEntityExtensions.WeldingGroupExists(MyEntity)
MyEntityExtensions.ProceduralWorldGeneratorTrackEntity(MyEntity)
MyEntityExtensions.TryGetInventory(MyEntity, out MyInventoryBase)
MyEntityExtensions.TryGetInventory(MyEntity, out MyInventory)
MyEntityExtensions.GetInventory(MyEntity, Int32)
MyEntityContainerEventExtensions.RaiseEntityEvent(MyEntity, MyStringHash, MyEntityContainerEventExtensions.EntityEventParams)
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾