Class Reactive

java.lang.Object
space.maxus.flare.react.Reactive

public final class Reactive extends Object
A utility class for reactivity within Flare.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <V> @NotNull ReactiveItemProvider<V>
    item(@NotNull ReactiveState<V> state, @NotNull org.apache.commons.lang3.concurrent.Computable<@Nullable V,@Nullable org.bukkit.inventory.ItemStack> provider)
    Creates a reactive item provider from a state and a provider.
    static <V> @NotNull ReactiveComponent<V>
    text(@NotNull ReactiveState<V> state, @NotNull org.apache.commons.lang3.concurrent.Computable<@Nullable V,net.kyori.adventure.text.Component> producer)
    Creates a reactive component from a state and a producer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • text

      @NotNull public static <V> @NotNull ReactiveComponent<V> text(@NotNull @NotNull ReactiveState<V> state, @NotNull @NotNull org.apache.commons.lang3.concurrent.Computable<@Nullable V,net.kyori.adventure.text.Component> producer)
      Creates a reactive component from a state and a producer.
      Type Parameters:
      V - The type of the reactive state
      Parameters:
      state - The reactive state to hook to
      producer - The producer to use to produce the reactive component
      Returns:
      The reactive component
    • item

      @NotNull public static <V> @NotNull ReactiveItemProvider<V> item(@NotNull @NotNull ReactiveState<V> state, @NotNull @NotNull org.apache.commons.lang3.concurrent.Computable<@Nullable V,@Nullable org.bukkit.inventory.ItemStack> provider)
      Creates a reactive item provider from a state and a provider. This is (partially) a wrapper around ItemProvider.reactive(Computable)
      Type Parameters:
      V - The type of the reactive state
      Parameters:
      state - The reactive state to hook to
      provider - The provider to use to produce the item reactively
      Returns:
      The reactive item provider