Record Class MenuBackgroundResult

java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.gui.background.MenuBackgroundResult
Record Components:
chosenBy - the name of the plugin whose resolver chose the texture, or null when the rules in guis.yml did
rulesApplied - whether the menu has rules in guis.yml and their when allowed them to run
variant - the variant the rules chose, or -1 when none matched
layers - the layers the rules added, in drawing order
texture - the glyphs in front of the menu name, coloured and followed by their reset; empty when the menu wears no texture
nameShown - whether the menu name follows the texture
title - the full title: the texture and, when shown, the name

public record MenuBackgroundResult(@Nullable String chosenBy, boolean rulesApplied, int variant, @NotNull List<Integer> layers, @NotNull String texture, boolean nameShown, @NotNull String title) extends Record
The texture one menu wears for one viewer, and how it was chosen.

The menu's title is the texture followed by the menu name, unless the name is hidden. Variant and layer numbers count the rules of the menu's background block in guis.yml from 0, in the order written; when an add-on resolver chose the texture they describe what the rules would have chosen.

Since:
1.15.0
  • Constructor Details

    • MenuBackgroundResult

      public MenuBackgroundResult(@Nullable @Nullable String chosenBy, boolean rulesApplied, int variant, @NotNull @NotNull List<Integer> layers, @NotNull @NotNull String texture, boolean nameShown, @NotNull @NotNull String title)
      Creates an instance of a MenuBackgroundResult record class.
      Parameters:
      chosenBy - the value for the chosenBy record component
      rulesApplied - the value for the rulesApplied record component
      variant - the value for the variant record component
      layers - the value for the layers record component
      texture - the value for the texture record component
      nameShown - the value for the nameShown record component
      title - the value for the title record component
  • Method Details

    • hasTexture

      public boolean hasTexture()
      Whether the menu wears a texture at all.
    • isChosenByAddon

      public boolean isChosenByAddon()
      Whether an add-on resolver, rather than guis.yml, chose the texture.
    • chooser

      @NotNull public @NotNull Optional<String> chooser()
      The plugin whose resolver chose the texture, when one did.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • chosenBy

      @Nullable public @Nullable String chosenBy()
      Returns the value of the chosenBy record component.
      Returns:
      the value of the chosenBy record component
    • rulesApplied

      public boolean rulesApplied()
      Returns the value of the rulesApplied record component.
      Returns:
      the value of the rulesApplied record component
    • variant

      public int variant()
      Returns the value of the variant record component.
      Returns:
      the value of the variant record component
    • layers

      @NotNull public @NotNull List<Integer> layers()
      Returns the value of the layers record component.
      Returns:
      the value of the layers record component
    • texture

      @NotNull public @NotNull String texture()
      Returns the value of the texture record component.
      Returns:
      the value of the texture record component
    • nameShown

      public boolean nameShown()
      Returns the value of the nameShown record component.
      Returns:
      the value of the nameShown record component
    • title

      @NotNull public @NotNull String title()
      Returns the value of the title record component.
      Returns:
      the value of the title record component