Record Class ClickGuiButtonTrigger.ClickGuiButtonTriggerInstance

java.lang.Object
java.lang.Record
com.minecolonies.api.advancements.ClickGuiButtonTrigger.ClickGuiButtonTriggerInstance
All Implemented Interfaces:
net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance, net.minecraft.advancements.CriterionTriggerInstance
Enclosing class:
ClickGuiButtonTrigger

public static record ClickGuiButtonTrigger.ClickGuiButtonTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, Optional<String> buttonId, Optional<net.minecraft.resources.ResourceLocation> windowResource) extends Record implements net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance
  • Field Details

  • Constructor Details

    • ClickGuiButtonTriggerInstance

      public ClickGuiButtonTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, Optional<String> buttonId, Optional<net.minecraft.resources.ResourceLocation> windowResource)
      Creates an instance of a ClickGuiButtonTriggerInstance record class.
      Parameters:
      player - the value for the player record component
      buttonId - the value for the buttonId record component
      windowResource - the value for the windowResource record component
  • Method Details

    • clickGuiButton

      public static net.minecraft.advancements.Criterion<ClickGuiButtonTrigger.ClickGuiButtonTriggerInstance> clickGuiButton()
    • clickGuiButton

      public static net.minecraft.advancements.Criterion<ClickGuiButtonTrigger.ClickGuiButtonTriggerInstance> clickGuiButton(String buttonId)
      Construct the check with a single button condition
      Parameters:
      buttonId - the button to be clicked to succeed
    • clickGuiButton

      public static net.minecraft.advancements.Criterion<ClickGuiButtonTrigger.ClickGuiButtonTriggerInstance> clickGuiButton(String buttonId, net.minecraft.resources.ResourceLocation windowResource)
      Construct the check more specifically
      Parameters:
      buttonId - the button to be clicked to succeed
      windowResource - the window id of the button to be clicked
    • test

      public boolean test(String buttonId, net.minecraft.resources.ResourceLocation windowResource)
      Performs the check for the conditions
      Parameters:
      buttonId - the id of the button that was just clicked
      windowResource - the blockui window id to check
      Returns:
      whether the check succeeded
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • player

      public Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player()
      Returns the value of the player record component.
      Specified by:
      player in interface net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance
      Returns:
      the value of the player record component
    • buttonId

      public Optional<String> buttonId()
      Returns the value of the buttonId record component.
      Returns:
      the value of the buttonId record component
    • windowResource

      public Optional<net.minecraft.resources.ResourceLocation> windowResource()
      Returns the value of the windowResource record component.
      Returns:
      the value of the windowResource record component