Record Class LootItemBlockStatePropertyCondition
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.predicates.LootItemBlockStatePropertyCondition
- All Implemented Interfaces:
- Predicate<LootContext>,- LootContextUser,- LootItemCondition
public record LootItemBlockStatePropertyCondition(Holder<Block> block, Optional<StatePropertiesPredicate> properties)
extends Record
implements LootItemCondition
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe field for theblockrecord component.static final com.mojang.serialization.Codec<LootItemBlockStatePropertyCondition>private final Optional<StatePropertiesPredicate>The field for thepropertiesrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionLootItemBlockStatePropertyCondition(Holder<Block> block, Optional<StatePropertiesPredicate> properties) Creates an instance of aLootItemBlockStatePropertyConditionrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionblock()Returns the value of theblockrecord component.final booleanIndicates whether some other object is "equal to" this one.Set<LootContextParam<?>>getType()hasBlockStateProperties(Block p_81770_) final inthashCode()Returns a hash code value for this object.Returns the value of thepropertiesrecord component.booleantest(LootContext p_81772_) final StringtoString()Returns a string representation of this record class.private static com.mojang.serialization.DataResult<LootItemBlockStatePropertyCondition>validate(LootItemBlockStatePropertyCondition p_298471_) Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUservalidate
- 
Field Details- 
blockThe field for theblockrecord component.
- 
propertiesThe field for thepropertiesrecord component.
- 
CODEC
 
- 
- 
Constructor Details- 
LootItemBlockStatePropertyConditionpublic LootItemBlockStatePropertyCondition(Holder<Block> block, Optional<StatePropertiesPredicate> properties) Creates an instance of aLootItemBlockStatePropertyConditionrecord class.- Parameters:
- block- the value for the- blockrecord component
- properties- the value for the- propertiesrecord component
 
 
- 
- 
Method Details- 
validateprivate static com.mojang.serialization.DataResult<LootItemBlockStatePropertyCondition> validate(LootItemBlockStatePropertyCondition p_298471_) 
- 
getType- Specified by:
- getTypein interface- LootItemCondition
 
- 
getReferencedContextParams- Specified by:
- getReferencedContextParamsin interface- LootContextUser
 
- 
test- Specified by:
- testin interface- Predicate<LootContext>
 
- 
hasBlockStateProperties
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
blockReturns the value of theblockrecord component.- Returns:
- the value of the blockrecord component
 
- 
propertiesReturns the value of thepropertiesrecord component.- Returns:
- the value of the propertiesrecord component
 
 
-