diff options
author | Linnea Gräf <nea@nea.moe> | 2025-03-11 17:58:47 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2025-03-11 17:58:47 +0100 |
commit | 03a1a00e57633ff30048d5af09fa10db9dcf423b (patch) | |
tree | 8ff130eb0684fa4839c85f6e1bb2d0bd5271f735 /src/main/kotlin/repo/item/SBItemProperty.kt | |
parent | 17a855a4bdfcca00b29f85981d8fb86968d9038c (diff) | |
download | Firmament-03a1a00e57633ff30048d5af09fa10db9dcf423b.tar.gz Firmament-03a1a00e57633ff30048d5af09fa10db9dcf423b.tar.bz2 Firmament-03a1a00e57633ff30048d5af09fa10db9dcf423b.zip |
feat: Add SBRecombobulatedexperiment/itemstacks
Diffstat (limited to 'src/main/kotlin/repo/item/SBItemProperty.kt')
-rw-r--r-- | src/main/kotlin/repo/item/SBItemProperty.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/kotlin/repo/item/SBItemProperty.kt b/src/main/kotlin/repo/item/SBItemProperty.kt index 55b8f01..fd85251 100644 --- a/src/main/kotlin/repo/item/SBItemProperty.kt +++ b/src/main/kotlin/repo/item/SBItemProperty.kt @@ -8,7 +8,7 @@ import moe.nea.firmament.util.compatloader.CompatLoader /** * A property of a skyblock item. Not every skyblock item must have this property, but some should. * - * Access to this class should be limited to [State.bindWith] and [SBItemData.getData]. + * Access to this class should be limited to [State.bind] and [SBItemData.getData]. * @see State */ abstract class SBItemProperty<T> { @@ -36,8 +36,12 @@ abstract class SBItemProperty<T> { * to change the state of an item, including its rendering as a vanilla [ItemStack]. */ abstract class State<T> : SBItemProperty<T>() { + /** + * Apply the stored info back to the item stack. If possible [stack] should be modified and returned directly, + * instead of creating a new [ItemStack] instance. Information stored here should be recovered using [fromStack]. + */ abstract fun applyToStack(stack: ItemStack, store: SBItemData, value: T?): ItemStack - fun bindWith(data: T) = BoundState(this, data) + fun bind(data: T) = BoundState(this, data) } /** |