Research

data class Research(key: NamespacedKey, val material: Material, val name: Component, val cost: Long?, val unlocks: Set<NamespacedKey>) : Record, Keyed(source)

A Pylon research as seem in the 'researches' guide section.

Researches typically have a research point cost specified. However, this is optional, and you can implement your own methods to unlock a research.

Constructors

Link copied to clipboard
constructor(key: NamespacedKey, material: Material, cost: Long?, vararg unlocks: NamespacedKey)

A constructor that sets the name to a default language file key.

constructor(key: NamespacedKey, material: Material, name: Component, cost: Long?, unlocks: Set<NamespacedKey>)

Types

Link copied to clipboard

Properties

Link copied to clipboard
val cost: Long?

If null, the research cannot be unlocked using points

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The keys of the items that are unlocked by this research

Functions

Link copied to clipboard
fun addTo(player: Player, sendMessage: Boolean = true, effects: Boolean = true)

Adds the research to a player.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun getKey(): NamespacedKey
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Returns whether a research has been researched by the given player.

Link copied to clipboard
open override fun key(): @NotNull Key
Link copied to clipboard
fun register()
Link copied to clipboard
fun removeFrom(player: Player)

Removes a research from a player.