Record Class PlaceStructureTrigger.PlaceStructureTriggerInstance
java.lang.Object
java.lang.Record
com.minecolonies.api.advancements.PlaceStructureTrigger.PlaceStructureTriggerInstance
- All Implemented Interfaces:
net.minecraft.advancements.critereon.SimpleCriterionTrigger.SimpleInstance,net.minecraft.advancements.CriterionTriggerInstance
- Enclosing class:
PlaceStructureTrigger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PlaceStructureTrigger.PlaceStructureTriggerInstance> -
Constructor Summary
ConstructorsConstructorDescriptionPlaceStructureTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, Optional<String> structureName) Creates an instance of aPlaceStructureTriggerInstancerecord 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<PlaceStructureTrigger.PlaceStructureTriggerInstance> static net.minecraft.advancements.Criterion<PlaceStructureTrigger.PlaceStructureTriggerInstance> placeStructure(String hutName) Construct the check with a single conditionOptional<net.minecraft.advancements.critereon.ContextAwarePredicate> player()Returns the value of theplayerrecord component.Returns the value of thestructureNamerecord component.booleanPerforms the check for the conditionsfinal StringtoString()Returns a string representation of this record class.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<PlaceStructureTrigger.PlaceStructureTriggerInstance> CODEC
-
-
Constructor Details
-
PlaceStructureTriggerInstance
public PlaceStructureTriggerInstance(Optional<net.minecraft.advancements.critereon.ContextAwarePredicate> player, Optional<String> structureName) Creates an instance of aPlaceStructureTriggerInstancerecord class.- Parameters:
player- the value for theplayerrecord componentstructureName- the value for thestructureNamerecord component
-
-
Method Details
-
placeStructure
public static net.minecraft.advancements.Criterion<PlaceStructureTrigger.PlaceStructureTriggerInstance> placeStructure() -
placeStructure
public static net.minecraft.advancements.Criterion<PlaceStructureTrigger.PlaceStructureTriggerInstance> placeStructure(String hutName) Construct the check with a single condition- Parameters:
hutName- the hut that has to be placed to succeed
-
test
Performs the check for the conditions- Parameters:
hutName- the id of the structure that was just placed- 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
-
structureName
Returns the value of thestructureNamerecord component.- Returns:
- the value of the
structureNamerecord component
-