Record Class PlacementContext
java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.world.gen.placement.PlacementContext
- Record Components:
level- The world generation access wrapper providing safe world modification.chunkX- The X coordinate of the chunk being processed.chunkZ- The Z coordinate of the chunk being processed.random- The seeded random source for deterministic placement.
public record PlacementContext(WorldGenAccess level, int chunkX, int chunkZ, Random random)
extends Record
A record containing context information required during the placement phase.
-
Constructor Summary
ConstructorsConstructorDescriptionPlacementContext(WorldGenAccess level, int chunkX, int chunkZ, Random random) Creates an instance of aPlacementContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintchunkX()Returns the value of thechunkXrecord component.intchunkZ()Returns the value of thechunkZrecord component.final booleanIndicates whether some other object is "equal to" this one.intRetrieves the maximum build height of the current world context.intRetrieves the minimum build height of the current world context.final inthashCode()Returns a hash code value for this object.level()Returns the value of thelevelrecord component.random()Returns the value of therandomrecord component.org.bukkit.LocationtoLocation(org.bukkit.util.Vector pos) Converts a vector position into a Bukkit Location using the world context.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
getMinBuildHeight
public int getMinBuildHeight()Retrieves the minimum build height of the current world context.- Returns:
- The minimum build height.
-
getHeight
public int getHeight()Retrieves the maximum build height of the current world context.- Returns:
- The maximum build height.
-
toLocation
public org.bukkit.Location toLocation(org.bukkit.util.Vector pos) Converts a vector position into a Bukkit Location using the world context.- Parameters:
pos- The vector position.- Returns:
- A standard Bukkit Location.
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
level
Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-
chunkX
public int chunkX()Returns the value of thechunkXrecord component.- Returns:
- the value of the
chunkXrecord component
-
chunkZ
public int chunkZ()Returns the value of thechunkZrecord component.- Returns:
- the value of the
chunkZrecord component
-
random
Returns the value of therandomrecord component.- Returns:
- the value of the
randomrecord component
-