Research

class Research(key: NamespacedKey, itemTemplate: ItemStack, val name: Component, val cost: Long?, val unlocks: Set<NamespacedKey>) : Keyed(source)

A Rebar 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, itemTemplate: ItemStack, name: Component, cost: Long?, unlocks: Set<NamespacedKey>)
constructor(key: NamespacedKey, item: ItemStack, cost: Long?, vararg unlocks: NamespacedKey)

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

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
open override val key: NamespacedKey
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 fun key(): @NotNull Key
Link copied to clipboard
fun register()
Link copied to clipboard
fun removeFrom(player: Player)

Removes a research from a player.