ProgressItem

open class ProgressItem @JvmOverloads constructor(item: Item, countDown: Boolean = true) : AbstractItem(source)

An item that counts down (or up if countDown is true) from a maximum durability, symbolising progress.

For example, this might be used in a custom furnace to show how much burn time is left on the current fuel. In this case, you'd want override setTotalTimeTicks and set it to the the total burn time of the fuel (eg: 80 seconds for coal), and then gradually increase progress as the remaining burn time decreased.

Using any set methods on here will automatically update the item in any windows that contain it.

Parameters

builder

The item stack builder to use for the item

countDown

If true, the progress bar will be inverted, meaning that 0.0 is full and 1.0 is empty.

Constructors

Link copied to clipboard
constructor(builder: ItemStackBuilder, inverse: Boolean = true)
constructor(material: Material, inverse: Boolean = true)
constructor(stack: ItemStack, inverse: Boolean = true)
constructor(item: Item, countDown: Boolean = true)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var item: Item

The item to be displayed

Link copied to clipboard
Link copied to clipboard

How far through the totalTime we are, between 0.0 and 1.0

Link copied to clipboard

The total time of whatever process this item is representing

Functions

Link copied to clipboard
open override fun addObserver(p0: Observer, p1: Int, p2: Int)
Link copied to clipboard
open override fun getItemProvider(viewer: Player): ItemProvider
Link copied to clipboard
open fun getUpdatePeriod(p0: Int): Int
Link copied to clipboard
open fun handleBundleSelect(p0: Player, p1: Int)
Link copied to clipboard
open override fun handleClick(clickType: ClickType, player: Player, click: Click)
Link copied to clipboard
open override fun notifyWindows()
Link copied to clipboard
open override fun removeObserver(p0: Observer, p1: Int, p2: Int)
Link copied to clipboard
fun setItem(stack: ItemStack)
fun setItem(item: Item)
Link copied to clipboard

Sets how far through the totalTime we are

Link copied to clipboard

Sets how far through the totalTime we are

Link copied to clipboard

Sets how far through the totalTime we are

Link copied to clipboard
fun setTotalTimeSeconds(seconds: Int?)
Link copied to clipboard
fun setTotalTimeTicks(ticks: Int?)