ServerObject
ThaumielMapEditor.API.Blocks
Overviewβ
Propertiesβ
| Name | Type | Access | Description |
|---|---|---|---|
IsStatic | bool | get set | Gets or Sets whether or not the ServerObject is static |
MovementSmoothing | byte | get set | The ticks between the server sending a update to the client about this object's position. 0 means no delay, 1 means the server will send an update every tick, 2 means every other tick, and so on. |
Name | string | get set | No description |
NetId | UInt32 | get | The NetId of the spawned ServerObject. |
Object | GameObject | get | Gets or sets the associated game object instance. |
ObjectId | int | get | Gets the object id from the ThaumielMapEditor.API.Serialization.SerializableObject this ThaumielMapEditor.API.Blocks.ServerObject instance was generated from. |
ObjectType | ObjectType | get set | Gets or sets the type of the object represented by this instance. |
ParentId | int | get | Gets the parent id from the ThaumielMapEditor.API.Serialization.SerializableObject this ThaumielMapEditor.API.Blocks.ServerObject instance was generated from. |
Position | Vector3 | get set | Gets or sets the Position of the ServerObject |
Rotation | Quaternion | get set | Gets or sets the Rotation of the ServerObject |
Scale | Vector3 | get set | Gets or sets the Scale of the ServerObject |
SpawnedObjects | List<ServerObject> | get set | No description |
Tools | IEnumerable<ToolBase> | get | Gets the ThaumielMapEditor.API.Components.Tools.ToolBase tools that are added to this ThaumielMapEditor.API.Blocks.ServerObject. |
Methodsβ
| Signature | Returns | Description |
|---|---|---|
DestroyObject(SchematicData) | void | Destroys the associated networked object and removes it from the specified schem⦠|
GetValue(SerializableObject, string) | T | Gets a value from `ThaumielMapEditor.API.Serialization.SerializableObject.Values⦠|
HideForPlayer(Player) | void | Hides the ThaumielMapEditor.API.Blocks.ServerObject on the client. |
SetWorldTransform(SchematicData) | void | Applies the specified schematic's transformation to the current object's world p⦠|
ShowForPlayer(Player) | void | Shows the ThaumielMapEditor.API.Blocks.ServerObject on the client. |
SpawnObject(SchematicData, SerializableObject) | void | Spawns the specified ThaumielMapEditor.API.Blocks.ServerObject into the server⦠|
UpdateObject(SchematicData, bool) | void | Updates the object's world transform and network state based on the specified sc⦠|
Propertiesβ
IsStaticβ
Type: boolβAccess: get set
Gets or Sets whether or not the ServerObject is static
MovementSmoothingβ
Type: byteβAccess: get set
The ticks between the server sending a update to the client about this object's position. 0 means no delay, 1 means the server will send an update every tick, 2 means every other tick, and so on.
Nameβ
Type: stringβAccess: get set
NetIdβ
Type: UInt32βAccess: get
The NetId of the spawned ServerObject.
Objectβ
Type: GameObjectβAccess: get
Gets or sets the associated game object instance.
ObjectIdβ
Type: intβAccess: get
Gets the object id from the ThaumielMapEditor.API.Serialization.SerializableObject this ThaumielMapEditor.API.Blocks.ServerObject instance was generated from.
ObjectTypeβ
Type: ObjectTypeβAccess: get set
Gets or sets the type of the object represented by this instance.
ParentIdβ
Type: intβAccess: get
Gets the parent id from the ThaumielMapEditor.API.Serialization.SerializableObject this ThaumielMapEditor.API.Blocks.ServerObject instance was generated from.
Positionβ
Type: Vector3βAccess: get set
Gets or sets the Position of the ServerObject
Rotationβ
Type: QuaternionβAccess: get set
Gets or sets the Rotation of the ServerObject
Scaleβ
Type: Vector3βAccess: get set
Gets or sets the Scale of the ServerObject
SpawnedObjectsβ
Type: List<ServerObject>βAccess: get set
Toolsβ
Type: IEnumerable<ToolBase>βAccess: get
Gets the ThaumielMapEditor.API.Components.Tools.ToolBase tools that are added to this ThaumielMapEditor.API.Blocks.ServerObject.
Methodsβ
DestroyObjectβ
public void DestroyObject(SchematicData schematic)
Destroys the associated networked object and removes it from the specified schematic's collection of spawned server objects.
Parametersβ
| Name | Type | Description |
|---|---|---|
schematic | SchematicData | The schematic data instance from which the object will be removed. |
GetValueβ
public T GetValue(
SerializableObject serializable,
string key
)
Gets a value from ThaumielMapEditor.API.Serialization.SerializableObject.Values and converts it to the specified type.
Parametersβ
| Name | Type | Description |
|---|---|---|
serializable | SerializableObject | The ThaumielMapEditor.API.Serialization.SerializableObject instance. |
key | string | The string key to lookup. |
Returnsβ
T
HideForPlayerβ
public void HideForPlayer(Player player)
Hides the ThaumielMapEditor.API.Blocks.ServerObject on the client.
Parametersβ
| Name | Type | Description |
|---|---|---|
player | Player |
SetWorldTransformβ
public void SetWorldTransform(SchematicData schematic)
Applies the specified schematic's transformation to the current object's world position, rotation, and scale.
Parametersβ
| Name | Type | Description |
|---|---|---|
schematic | SchematicData | The schematic data containing the position, rotation, and scale to apply to the current object. |
ShowForPlayerβ
public void ShowForPlayer(Player player)
Shows the ThaumielMapEditor.API.Blocks.ServerObject on the client.
Parametersβ
| Name | Type | Description |
|---|---|---|
player | Player |
SpawnObjectβ
public void SpawnObject(
SchematicData schematic,
SerializableObject serializable
)
Spawns the specified ThaumielMapEditor.API.Blocks.ServerObject into the server and adds it to the provided ThaumielMapEditor.API.Data.SchematicData's ThaumielMapEditor.API.Data.SchematicData.SpawnedServerObjects list.
Parametersβ
| Name | Type | Description |
|---|---|---|
schematic | SchematicData | |
serializable | SerializableObject |
UpdateObjectβ
public void UpdateObject(
SchematicData schematic,
bool respawn
)
Updates the object's world transform and network state based on the specified schematic data, optionally respawning the object on the network.
If the object is not currently spawned, this method will not perform any update. The method also updates the object's network synchronization component if present.
Parametersβ
| Name | Type | Description |
|---|---|---|
schematic | SchematicData | The schematic data used to update the object's position and rotation. |
respawn | bool | If true, the object is respawned on the network after updating. If false, the object is not respawned. |