Package net.minecraft.world.level
Record Class SpawnData.CustomSpawnRules
java.lang.Object
java.lang.Record
net.minecraft.world.level.SpawnData.CustomSpawnRules
- Enclosing class:
SpawnData
public static record SpawnData.CustomSpawnRules(InclusiveRange<Integer> blockLightLimit, InclusiveRange<Integer> skyLightLimit)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InclusiveRange<Integer> The field for theblockLightLimitrecord component.static final com.mojang.serialization.Codec<SpawnData.CustomSpawnRules> private static final InclusiveRange<Integer> private final InclusiveRange<Integer> The field for theskyLightLimitrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCustomSpawnRules(InclusiveRange<Integer> blockLightLimit, InclusiveRange<Integer> skyLightLimit) Creates an instance of aCustomSpawnRulesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblockLightLimitrecord component.private static com.mojang.serialization.DataResult<InclusiveRange<Integer>> checkLightBoundaries(InclusiveRange<Integer> p_186593_) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisValidPosition(BlockPos p_321770_, ServerLevel p_321818_) private static com.mojang.serialization.MapCodec<InclusiveRange<Integer>> lightLimit(String p_286409_) Returns the value of theskyLightLimitrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
blockLightLimit
The field for theblockLightLimitrecord component. -
skyLightLimit
The field for theskyLightLimitrecord component. -
LIGHT_RANGE
-
CODEC
-
-
Constructor Details
-
CustomSpawnRules
public CustomSpawnRules(InclusiveRange<Integer> blockLightLimit, InclusiveRange<Integer> skyLightLimit) Creates an instance of aCustomSpawnRulesrecord class.- Parameters:
blockLightLimit- the value for theblockLightLimitrecord componentskyLightLimit- the value for theskyLightLimitrecord component
-
-
Method Details
-
checkLightBoundaries
private static com.mojang.serialization.DataResult<InclusiveRange<Integer>> checkLightBoundaries(InclusiveRange<Integer> p_186593_) -
lightLimit
private static com.mojang.serialization.MapCodec<InclusiveRange<Integer>> lightLimit(String p_286409_) -
isValidPosition
-
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). -
blockLightLimit
Returns the value of theblockLightLimitrecord component.- Returns:
- the value of the
blockLightLimitrecord component
-
skyLightLimit
Returns the value of theskyLightLimitrecord component.- Returns:
- the value of the
skyLightLimitrecord component
-