Record Class ChunkTrackingView.Positioned
java.lang.Object
java.lang.Record
net.minecraft.server.level.ChunkTrackingView.Positioned
- All Implemented Interfaces:
ChunkTrackingView
- Enclosing interface:
ChunkTrackingView
public static record ChunkTrackingView.Positioned(ChunkPos center, int viewDistance)
extends Record
implements ChunkTrackingView
-
Nested Class Summary
Nested classes/interfaces inherited from interface ChunkTrackingView
ChunkTrackingView.Positioned -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChunkPosThe field for thecenterrecord component.private final intThe field for theviewDistancerecord component.Fields inherited from interface ChunkTrackingView
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionPositioned(ChunkPos center, int viewDistance) Creates an instance of aPositionedrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncenter()Returns the value of thecenterrecord component.booleancontains(int chunkX, int chunkZ, boolean includeNeighbors) final booleanIndicates whether some other object is "equal to" this one.voidfinal inthashCode()Returns a hash code value for this object.private intmaxX()private intmaxZ()private intminX()private intminZ()protected booleanDetermines if anotherChunkTrackingView's bounds intersects with its ownfinal StringtoString()Returns a string representation of this record class.intReturns the value of theviewDistancerecord component.Methods inherited from interface ChunkTrackingView
contains, contains, isInViewDistance
-
Field Details
-
center
The field for thecenterrecord component. -
viewDistance
private final int viewDistanceThe field for theviewDistancerecord component.
-
-
Constructor Details
-
Positioned
Creates an instance of aPositionedrecord class.- Parameters:
center- the value for thecenterrecord componentviewDistance- the value for theviewDistancerecord component
-
-
Method Details
-
minX
private int minX() -
minZ
private int minZ() -
maxX
private int maxX() -
maxZ
private int maxZ() -
squareIntersects
Determines if anotherChunkTrackingView's bounds intersects with its own -
contains
public boolean contains(int chunkX, int chunkZ, boolean includeNeighbors) - Specified by:
containsin interfaceChunkTrackingView
-
forEach
- Specified by:
forEachin interfaceChunkTrackingView
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
center
Returns the value of thecenterrecord component.- Returns:
- the value of the
centerrecord component
-
viewDistance
public int viewDistance()Returns the value of theviewDistancerecord component.- Returns:
- the value of the
viewDistancerecord component
-