Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DoodadManager

Hierarchy

Implements

Index

Constructors

constructor

  • Returns DoodadManager

Properties

Readonly event

event: IEventEmitter<this, IDoodadManagerEvents> = new EventEmitter<this, E>(this)

Methods

create

  • Parameters

    • type: DoodadType
    • x: number
    • y: number
    • z: number
    • Default value options: IDoodadOptions = {}
    • Optional creator: Human

    Returns Doodad | undefined

createFake

  • createFake(type: DoodadType, options?: IDoodadOptions, x?: number, y?: number, z?: number): Doodad
  • Parameters

    • type: DoodadType
    • Default value options: IDoodadOptions = {}
    • Default value x: number = 0
    • Default value y: number = 0
    • Default value z: number = 0

    Returns Doodad

generateLookups

  • generateLookups(): void
  • Returns void

getBestDoodadForTier

getDoodadTypeGroupName

  • getDoodadTypeGroupName(doodadType: DoodadType | DoodadTypeGroup, article?: undefined | false | true, count?: undefined | number): Translation
  • Parameters

    • doodadType: DoodadType | DoodadTypeGroup
    • Optional article: undefined | false | true
    • Optional count: undefined | number

    Returns Translation

getGroupDoodads

  • Parameters

    Returns Set<DoodadType>

isGroup

  • isGroup(doodadType: DoodadType | DoodadTypeGroup): doodadType is DoodadTypeGroup
  • Parameters

    Returns doodadType is DoodadTypeGroup

isInGroup

  • isInGroup(doodadType: DoodadType, doodadGroup: DoodadTypeGroup | DoodadType): boolean
  • Parameters

    Returns boolean

remove

  • remove(doodad: Doodad, removeItems?: boolean): void
  • Removes a doodad from the world.

    Parameters

    • doodad: Doodad

      The doodad to remove

    • Default value removeItems: boolean = false

      Whether to remove items.

      Note: This method will remove any items in them whether the removeItems parameter is provided or not. If the parameter is not provided, the assumption is that it will only be called on empty doodads. Therefore, if there are items, it will log a warning.

    Returns void

spawn

  • spawn(terrainType: TerrainType, x: number, y: number, z: number): void
  • Used to spawn a random doodad on the current biome type and at a set location (and terrain type) based on spawnOnWorldGen properties in doodad descriptions.

    Parameters

    • terrainType: TerrainType

      The terrain type to check.

    • x: number

      The x coordinate to check.

    • y: number

      The y coordinate to check.

    • z: number

      The z coordinate to check.

    Returns void

updateAll

  • updateAll(ticks: number, realPlayers: Player[], updatesPerTick?: number): void
  • Runs a full gamut of updates on doodads including decaying items inside containers, spreading/growing plants/mushrooms, water distillation/desenation and more.

    Parameters

    • ticks: number
    • realPlayers: Player[]
    • Default value updatesPerTick: number = 1

    Returns void

updateAllAsync

  • updateAllAsync(ticks: number, realPlayers: Player[], updatesPerTick?: number, onProgress: (progess: number) => Promise<void>): Promise<void>
  • Runs a full gamut of updates on doodads including decaying items inside containers, spreading/growing plants/mushrooms, water distillation/desenation and more.

    Parameters

    • ticks: number
    • realPlayers: Player[]
    • Default value updatesPerTick: number = 1
    • onProgress: (progess: number) => Promise<void>
        • Parameters

          • progess: number

          Returns Promise<void>

    Returns Promise<void>

verifyAndFixItemWeights

  • verifyAndFixItemWeights(): void
  • Returns void

Generated using TypeDoc