Class PhaseData<T,P extends PhaseData<T,P>>

java.lang.Object
org.quiltmc.qsl.base.api.phase.PhaseData<T,P>
Type Parameters:
T - the type of data held in a phase
P - the type of the phase data

public class PhaseData<T,P extends PhaseData<T,P>> extends Object
Data of a phase.
  • Field Details

    • id

      final net.minecraft.util.Identifier id
    • data

      protected T data
    • subsequentPhases

      protected final List<P extends PhaseData<T,P>> subsequentPhases
    • previousPhases

      protected final List<P extends PhaseData<T,P>> previousPhases
    • visitStatus

  • Constructor Details

    • PhaseData

      public PhaseData(@NotNull @NotNull net.minecraft.util.Identifier id, T data)
  • Method Details

    • getId

      @Contract(pure=true) @NotNull public @NotNull net.minecraft.util.Identifier getId()
      Returns the identifier of this phase.
      Returns:
      the identifier of this phase
    • getData

      @Contract(pure=true) public T getData()
      Returns the data held by this phase.
      Returns:
      the data held by this phase
    • addSubsequentPhase

      protected void addSubsequentPhase(P phase)
    • addPreviousPhase

      protected void addPreviousPhase(P phase)
    • link

      public static <T, P extends PhaseData<T, P>> void link(@NotNull P first, @NotNull P second)
      Links two given phases together.
      Type Parameters:
      T - the type of data held by the phases
      Parameters:
      first - the phase that should be ordered first
      second - the phase that should be ordered second