Record Class OpenGuiWindowTrigger.OpenGuiWindowTriggerInstance
java.lang.Object
java.lang.Record
com.minecolonies.api.advancements.OpenGuiWindowTrigger.OpenGuiWindowTriggerInstance
- All Implemented Interfaces:
net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance,net.minecraft.advancements.CriterionTriggerInstance
- Enclosing class:
OpenGuiWindowTrigger
public static record OpenGuiWindowTrigger.OpenGuiWindowTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, Optional<net.minecraft.resources.ResourceLocation> windowResource)
extends Record
implements net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<OpenGuiWindowTrigger.OpenGuiWindowTriggerInstance> -
Constructor Summary
ConstructorsConstructorDescriptionOpenGuiWindowTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, Optional<net.minecraft.resources.ResourceLocation> windowResource) Creates an instance of aOpenGuiWindowTriggerInstancerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static net.minecraft.advancements.Criterion<OpenGuiWindowTrigger.OpenGuiWindowTriggerInstance> static net.minecraft.advancements.Criterion<OpenGuiWindowTrigger.OpenGuiWindowTriggerInstance> openGuiWindow(net.minecraft.resources.ResourceLocation windowResource) Construct the check with a single conditionOptional<net.minecraft.advancements.critereon.ContextAwarePredicate> player()Returns the value of theplayerrecord component.booleantest(net.minecraft.resources.ResourceLocation windowResource) Performs the check for the conditionsfinal StringtoString()Returns a string representation of this record class.Optional<net.minecraft.resources.ResourceLocation> Returns the value of thewindowResourcerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance
validate
-
Field Details
-
CODEC
public static final com.mojang.serialization.Codec<OpenGuiWindowTrigger.OpenGuiWindowTriggerInstance> CODEC
-
-
Constructor Details
-
OpenGuiWindowTriggerInstance
public OpenGuiWindowTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, Optional<net.minecraft.resources.ResourceLocation> windowResource) Creates an instance of aOpenGuiWindowTriggerInstancerecord class.- Parameters:
player- the value for theplayerrecord componentwindowResource- the value for thewindowResourcerecord component
-
-
Method Details
-
openGuiWindow
public static net.minecraft.advancements.Criterion<OpenGuiWindowTrigger.OpenGuiWindowTriggerInstance> openGuiWindow() -
openGuiWindow
public static net.minecraft.advancements.Criterion<OpenGuiWindowTrigger.OpenGuiWindowTriggerInstance> openGuiWindow(net.minecraft.resources.ResourceLocation windowResource) Construct the check with a single condition- Parameters:
windowResource- the window that has to be opened to succeed
-
test
public boolean test(net.minecraft.resources.ResourceLocation windowResource) Performs the check for the conditions- Parameters:
windowResource- the blockui window id that was just opened- Returns:
- whether the check succeeded
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
player
Returns the value of theplayerrecord component.- Specified by:
playerin interfacenet.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance- Returns:
- the value of the
playerrecord component
-
windowResource
Returns the value of thewindowResourcerecord component.- Returns:
- the value of the
windowResourcerecord component
-