Skip to main content

ServerObject

class ThaumielMapEditor.API.Blocks

Overview​

Properties​

NameTypeAccessDescription
IsStaticboolget setGets or Sets whether or not the ServerObject is static
MovementSmoothingbyteget setThe 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.
Namestringget setNo description
NetIdUInt32getThe NetId of the spawned ServerObject.
ObjectGameObjectgetGets or sets the associated game object instance.
ObjectIdintgetGets the object id from the ThaumielMapEditor.API.Serialization.SerializableObject this ThaumielMapEditor.API.Blocks.ServerObject instance was generated from.
ObjectTypeObjectTypeget setGets or sets the type of the object represented by this instance.
ParentIdintgetGets the parent id from the ThaumielMapEditor.API.Serialization.SerializableObject this ThaumielMapEditor.API.Blocks.ServerObject instance was generated from.
PositionVector3get setGets or sets the Position of the ServerObject
RotationQuaternionget setGets or sets the Rotation of the ServerObject
ScaleVector3get setGets or sets the Scale of the ServerObject
SpawnedObjectsList<ServerObject>get setNo description
ToolsIEnumerable<ToolBase>getGets the ThaumielMapEditor.API.Components.Tools.ToolBase tools that are added to this ThaumielMapEditor.API.Blocks.ServerObject.

Methods​

SignatureReturnsDescription
DestroyObject(SchematicData)voidDestroys the associated networked object and removes it from the specified schem…
GetValue(SerializableObject, string)TGets a value from `ThaumielMapEditor.API.Serialization.SerializableObject.Values…
HideForPlayer(Player)voidHides the ThaumielMapEditor.API.Blocks.ServerObject on the client.
SetWorldTransform(SchematicData)voidApplies the specified schematic's transformation to the current object's world p…
ShowForPlayer(Player)voidShows the ThaumielMapEditor.API.Blocks.ServerObject on the client.
SpawnObject(SchematicData, SerializableObject)voidSpawns the specified ThaumielMapEditor.API.Blocks.ServerObject into the server…
UpdateObject(SchematicData, bool)voidUpdates 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​

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​

NameTypeDescription
schematicSchematicDataThe schematic data instance from which the object will be removed.

GetValue​

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​

NameTypeDescription
serializableSerializableObjectThe ThaumielMapEditor.API.Serialization.SerializableObject instance.
keystringThe string key to lookup.

Returns​

T


HideForPlayer​

HideForPlayer
public void HideForPlayer(Player player)

Hides the ThaumielMapEditor.API.Blocks.ServerObject on the client.

Parameters​

NameTypeDescription
playerPlayer

SetWorldTransform​

SetWorldTransform
public void SetWorldTransform(SchematicData schematic)

Applies the specified schematic's transformation to the current object's world position, rotation, and scale.

Parameters​

NameTypeDescription
schematicSchematicDataThe schematic data containing the position, rotation, and scale to apply to the current object.

ShowForPlayer​

ShowForPlayer
public void ShowForPlayer(Player player)

Shows the ThaumielMapEditor.API.Blocks.ServerObject on the client.

Parameters​

NameTypeDescription
playerPlayer

SpawnObject​

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​

NameTypeDescription
schematicSchematicData
serializableSerializableObject

UpdateObject​

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.

Remarks

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​

NameTypeDescription
schematicSchematicDataThe schematic data used to update the object's position and rotation.
respawnboolIf true, the object is respawned on the network after updating. If false, the object is not respawned.