Class AdvancementVisibility

java.lang.Object
eu.endercentral.crazy_advancements.advancement.AdvancementVisibility

public abstract class AdvancementVisibility extends Object
Represents the conditions under which an Advancement is visible
Author:
Axel
  • Field Details

    • ALWAYS

      public static final AdvancementVisibility ALWAYS
      Advancements with this Visibility will always be visible
    • PARENT_GRANTED

      public static final AdvancementVisibility PARENT_GRANTED
      Advancements with this Visibility will be visible once their parent or any of their children is granted
    • VANILLA

      public static final AdvancementVisibility VANILLA
      Advancements with this Visibility will be visible once their parent or grandparent or any of their children is granted (Similar to Vanilla behavior)
    • HIDDEN

      public static final AdvancementVisibility HIDDEN
      Advancements with this Visibility will be visible once they are granted or any of their children is granted (Similar to Vanilla "hidden")
  • Constructor Details

    • AdvancementVisibility

      public AdvancementVisibility()
      Constructor for creating custom Advancement Visibility
  • Method Details

    • isVisible

      public abstract boolean isVisible(Player player, Advancement advancement)
      Do not call this method directly, use AdvancementVisibility to get accurate visibility data
      Parameters:
      player - Player to check
      advancement - Advancement to check
      Returns:
      true if advancement should be visible
    • isAlwaysVisibleWhenAnyChildIsGranted

      public boolean isAlwaysVisibleWhenAnyChildIsGranted()
      Returns:
      true if advancement should always be visible if any child is granted, defaults to true
    • getName

      public String getName()
      Returns:
      Custom Name, only for pre-defined visibilities: ALWAYS, PARENT_GRANTED, VANILLA, HIDDEN
    • parseVisibility

      public static AdvancementVisibility parseVisibility(String name)
      Parses a visibility
      Parameters:
      name - Visibility Name
      Returns:
      A visibility with a matching getName() or VANILLA