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
-
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. -
level
-
chunkX
-
chunkZ
-
random
-