Home Reference Source
import {MinerComponent} from 'shapez.io/js/game/components/miner.js'
public class | source

MinerComponent

Extends:

BasicSerializableObjectComponent → MinerComponent

Static Method Summary

Static Public Methods
public static
public static

getSchema(): {"lastMiningTime": *, "itemChainBuffer": *}

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

Which miner this miner ejects to, in case its a chainable one.

public
public
public

Stores items from other miners which were chained to this miner.

public

Method Summary

Public Methods
public

Inherited Summary

From class BasicSerializableObject
public static
public static

getId()

public static

Should return the serialization schema

public static

verify(data: *): string | void

public

deserialize(data: any, root: import("./savegame_serializer").GameRoot): string | void

public
From class Component
public static

Returns the components unique id

public static

getSchema(): {}

Should return the schema used for serialization

public

copyAdditionalStateTo(otherComponent: Component)

Copy the current state to another component

public

Returns a string representing the components data, only in dev builds

Static Public Methods

public static getId(): string source

Returns the components unique id

Override:

Component#getId

Return:

string

public static getSchema(): {"lastMiningTime": *, "itemChainBuffer": *} source

Should return the schema used for serialization

Override:

Component#getSchema

Return:

{"lastMiningTime": *, "itemChainBuffer": *}

Public Constructors

public constructor() source

Fixes typeof DerivedComponent is not assignable to typeof Component, compiled out in non-dev builds

Override:

Component#constructor

Public Members

public cachedChainedMiner: Entity | null | false source

Which miner this miner ejects to, in case its a chainable one. If the value is false, it means there is no entity, and we don't have to re-check

public cachedMinedItem: BaseItem source

public chainable: * source

public itemChainBuffer: Array<BaseItem> source

Stores items from other miners which were chained to this miner.

public lastMiningTime: number source

Public Methods

public tryAcceptChainedItem(item: BaseItem): boolean source

Params:

NameTypeAttributeDescription
item BaseItem

Return:

boolean