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 inguis.ymldidrulesApplied- whether the menu has rules inguis.ymland theirwhenallowed them to runvariant- the variant the rules chose, or -1 when none matchedlayers- the layers the rules added, in drawing ordertexture- the glyphs in front of the menu name, coloured and followed by their reset; empty when the menu wears no texturenameShown- whether the menu name follows the texturetitle- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchooser()The plugin whose resolver chose the texture, when one did.@Nullable StringchosenBy()Returns the value of thechosenByrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanWhether the menu wears a texture at all.booleanWhether an add-on resolver, rather thanguis.yml, chose the texture.layers()Returns the value of thelayersrecord component.booleanReturns the value of thenameShownrecord component.booleanReturns the value of therulesAppliedrecord component.@NotNull Stringtexture()Returns the value of thetexturerecord component.@NotNull Stringtitle()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.intvariant()Returns the value of thevariantrecord component.
-
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 aMenuBackgroundResultrecord class.- Parameters:
chosenBy- the value for thechosenByrecord componentrulesApplied- the value for therulesAppliedrecord componentvariant- the value for thevariantrecord componentlayers- the value for thelayersrecord componenttexture- the value for thetexturerecord componentnameShown- the value for thenameShownrecord componenttitle- the value for thetitlerecord 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 thanguis.yml, chose the texture. -
chooser
The plugin whose resolver chose the texture, when one did. -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
chosenBy
Returns the value of thechosenByrecord component.- Returns:
- the value of the
chosenByrecord component
-
rulesApplied
public boolean rulesApplied()Returns the value of therulesAppliedrecord component.- Returns:
- the value of the
rulesAppliedrecord component
-
variant
public int variant()Returns the value of thevariantrecord component.- Returns:
- the value of the
variantrecord component
-
layers
Returns the value of thelayersrecord component.- Returns:
- the value of the
layersrecord component
-
texture
Returns the value of thetexturerecord component.- Returns:
- the value of the
texturerecord component
-
nameShown
public boolean nameShown()Returns the value of thenameShownrecord component.- Returns:
- the value of the
nameShownrecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-