Record Class MoonBrightnessCheck
java.lang.Object
java.lang.Record
net.minecraft.world.entity.variant.MoonBrightnessCheck
- All Implemented Interfaces:
Predicate<SpawnContext>, PriorityProvider.SelectorCondition<SpawnContext>, SpawnCondition
public record MoonBrightnessCheck(MinMaxBounds.Doubles range)
extends Record
implements SpawnCondition
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<MoonBrightnessCheck> private final MinMaxBounds.DoublesThe field for therangerecord component.Fields inherited from interface SpawnCondition
CODEC -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aMoonBrightnessCheckrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<MoonBrightnessCheck> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.range()Returns the value of therangerecord component.booleantest(SpawnContext context) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
range
The field for therangerecord component. -
MAP_CODEC
-
-
Constructor Details
-
MoonBrightnessCheck
Creates an instance of aMoonBrightnessCheckrecord class.- Parameters:
range- the value for therangerecord component
-
-
Method Details
-
test
- Specified by:
testin interfacePredicate<SpawnContext>
-
codec
- Specified by:
codecin interfaceSpawnCondition
-
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). -
range
Returns the value of therangerecord component.- Returns:
- the value of the
rangerecord component
-