Record Class WeatherCheck
java.lang.Object
java.lang.Record
net.minecraft.world.level.storage.loot.predicates.WeatherCheck
- All Implemented Interfaces:
Predicate<LootContext>, LootContextUser, LootItemCondition, Validatable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theisRainingrecord component.The field for theisThunderingrecord component.static final com.mojang.serialization.MapCodec<WeatherCheck> Fields inherited from interface LootItemCondition
CODEC, DIRECT_CODEC, TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionWeatherCheck(Optional<Boolean> isRaining, Optional<Boolean> isThundering) Creates an instance of aWeatherCheckrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<WeatherCheck> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theisRainingrecord component.Returns the value of theisThunderingrecord component.booleantest(LootContext context) final StringtoString()Returns a string representation of this record class.static WeatherCheck.Builderweather()Methods inherited from interface LootContextUser
getReferencedContextParams, validate
-
Field Details
-
isRaining
-
isThundering
-
MAP_CODEC
-
-
Constructor Details
-
WeatherCheck
-
-
Method Details
-
codec
- Specified by:
codecin interfaceLootItemCondition
-
test
- Specified by:
testin interfacePredicate<LootContext>
-
weather
-
toString
-
hashCode
-
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). -
isRaining
-
isThundering
-