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
Modifier and TypeFieldDescriptionprivate final InclusiveRange
<Integer> The field for theblockLightLimit
record component.static final com.mojang.serialization.Codec
<SpawnData.CustomSpawnRules> private static final InclusiveRange
<Integer> private final InclusiveRange
<Integer> The field for theskyLightLimit
record component. -
Constructor Summary
ConstructorDescriptionCustomSpawnRules
(InclusiveRange<Integer> blockLightLimit, InclusiveRange<Integer> skyLightLimit) Creates an instance of aCustomSpawnRules
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblockLightLimit
record component.private static com.mojang.serialization.DataResult
<InclusiveRange<Integer>> checkLightBoundaries
(InclusiveRange<Integer> p_186593_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
isValidPosition
(BlockPos p_321770_, ServerLevel p_321818_) private static com.mojang.serialization.MapCodec
<InclusiveRange<Integer>> lightLimit
(String p_286409_) Returns the value of theskyLightLimit
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
blockLightLimit
The field for theblockLightLimit
record component. -
skyLightLimit
The field for theskyLightLimit
record component. -
LIGHT_RANGE
-
CODEC
-
-
Constructor Details
-
CustomSpawnRules
public CustomSpawnRules(InclusiveRange<Integer> blockLightLimit, InclusiveRange<Integer> skyLightLimit) Creates an instance of aCustomSpawnRules
record class.- Parameters:
blockLightLimit
- the value for theblockLightLimit
record componentskyLightLimit
- the value for theskyLightLimit
record 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 theblockLightLimit
record component.- Returns:
- the value of the
blockLightLimit
record component
-
skyLightLimit
Returns the value of theskyLightLimit
record component.- Returns:
- the value of the
skyLightLimit
record component
-