Skip to content

Omegga Player API

Isaac Hirschfeld edited this page Feb 14, 2021 · 1 revision

Player

Kind: global class

new Player(omegga, name, id, controller, state)

players are not to be constructed

Param Type Description
omegga Omegga Omegga Instance
name String Player Name
id String Player Id
controller String Player Controller
state String Player State

player.getOmegga() ⇒ Omegga

Returns omegga

Kind: instance method of Player

player.clone() ⇒ Player

Clone a player

Kind: instance method of Player

player.raw() ⇒ Array.<String>

Get raw player info (to feed into a constructor)

Kind: instance method of Player

player.isHost() ⇒ Boolean

true if the player is the host

Kind: instance method of Player

player.clearBricks(quiet)

clear this player's bricks

Kind: instance method of Player

Param Type Default Description
quiet Boolean false quiet mode

player.getRoles() ⇒ Array.<String>

get a player's roles, if any

Kind: instance method of Player

player.getPermissions() ⇒ Object

get a player's permissions in a map like {"Bricks.ClearOwn": true, ...}

Kind: instance method of Player Returns: Object - - permissions map

player.getNameColor() ⇒ String

get player's name color

Kind: instance method of Player Returns: String - - 6 character hex string

player.getPosition() ⇒ Promise.<List.<Number>>

get player's position

Kind: instance method of Player Returns: Promise.<List.<Number>> - - [x, y, z] coordinates

player.getGhostBrick() ⇒ Promise.<Object>

gets a user's ghost brick info (by uuid, name, controller, or player object)

Kind: instance method of Player Returns: Promise.<Object> - - ghost brick data

player.getPaint() ⇒ Promise.<Object>

gets a user's paint tool properties

Kind: instance method of Player Returns: Promise.<Object> - - paint data

player.getTemplateBounds() ⇒ Promise.<Object>

gets the bounds of the template in the user's clipboard (bounds of original selection box)

Kind: instance method of Player Returns: Promise.<Object> - - template bounds

player.getTemplateBoundsData() ⇒ Promise.<SaveData>

get bricks inside template bounds

Kind: instance method of Player Returns: Promise.<SaveData> - - BRS JS Save Data

player.loadDataAtGhostBrick(saveData) ⇒ Promise

load bricks at ghost brick location

Kind: instance method of Player Returns: Promise - - BRS JS Save Data

Param Type Description
saveData SaveData player or player identifier
Number save load X offset
Number save load Y offset
Number save load Z offset
Boolean quiet mode

Player.getRoles(omegga, id) ⇒ Array.<String>

get a player's roles, if any

Kind: static method of Player Returns: Array.<String> - - list of roles

Param Type Description
omegga Omegga omegga instance
id String player uuid

Player.getPermissions(omegga, id) ⇒ Object

get a player's permissions in a map like {"Bricks.ClearOwn": true, ...}

Kind: static method of Player Returns: Object - - permissions map

Param Type Description
omegga Omegga Omegga instance
id String player uuid