Package io.papermc.paper.raytracing
Interface PositionedRayTraceConfigurationBuilder
A builder for configuring a raytrace with a starting location
and direction.
-
Method Summary
Modifier and TypeMethodDescriptionblockFilter
(Predicate<? super Block> blockFilter) Sets the current block filter when looking for block collisions.Sets the direction.entityFilter
(Predicate<? super Entity> entityFilter) Sets the current entity filter when looking for entity collisions.fluidCollisionMode
(FluidCollisionMode fluidCollisionMode) Sets the FluidCollisionMode when looking for block collisions.ignorePassableBlocks
(boolean ignorePassableBlocks) Sets whether the raytrace should ignore passable blocks when looking for block collisions.maxDistance
(@org.checkerframework.checker.index.qual.NonNegative double maxDistance) Sets the maximum distance.raySize
(@org.checkerframework.checker.index.qual.NonNegative double raySize) Sets the size of the raytrace when looking for entity collisions.Sets the starting location.targets
(RayTraceTarget first, RayTraceTarget... others) Sets the targets for the rayTrace.
-
Method Details
-
start
@Contract(value="_ -> this", mutates="this") PositionedRayTraceConfigurationBuilder start(Location start) Sets the starting location.- Parameters:
start
- the new starting location- Returns:
- a reference to this object
-
direction
@Contract(value="_ -> this", mutates="this") PositionedRayTraceConfigurationBuilder direction(Vector direction) Sets the direction.- Parameters:
direction
- the new direction- Returns:
- a reference to this object
-
maxDistance
@Contract(value="_ -> this", mutates="this") PositionedRayTraceConfigurationBuilder maxDistance(@org.checkerframework.checker.index.qual.NonNegative double maxDistance) Sets the maximum distance.- Parameters:
maxDistance
- the new maxDistance- Returns:
- a reference to this object
-
fluidCollisionMode
@Contract(value="_ -> this", mutates="this") PositionedRayTraceConfigurationBuilder fluidCollisionMode(FluidCollisionMode fluidCollisionMode) Sets the FluidCollisionMode when looking for block collisions.If collisions with passable blocks are ignored, fluid collisions are ignored as well regardless of the fluid collision mode.
- Parameters:
fluidCollisionMode
- the new FluidCollisionMode- Returns:
- a reference to this object
-
ignorePassableBlocks
@Contract(value="_ -> this", mutates="this") PositionedRayTraceConfigurationBuilder ignorePassableBlocks(boolean ignorePassableBlocks) Sets whether the raytrace should ignore passable blocks when looking for block collisions.If collisions with passable blocks are ignored, fluid collisions are ignored as well regardless of the fluid collision mode.
Portal blocks are only considered passable if the ray starts within them. Apart from that collisions with portal blocks will be considered even if collisions with passable blocks are otherwise ignored.
- Parameters:
ignorePassableBlocks
- if the raytrace should ignore passable blocks- Returns:
- a reference to this object
-
raySize
@Contract(value="_ -> this", mutates="this") PositionedRayTraceConfigurationBuilder raySize(@org.checkerframework.checker.index.qual.NonNegative double raySize) Sets the size of the raytrace when looking for entity collisions.- Parameters:
raySize
- the new raytrace size- Returns:
- a reference to this object
-
entityFilter
@Contract(value="_ -> this", mutates="this") PositionedRayTraceConfigurationBuilder entityFilter(Predicate<? super Entity> entityFilter) Sets the current entity filter when looking for entity collisions.- Parameters:
entityFilter
- predicate for entities the ray can potentially collide with- Returns:
- a reference to this object
-
blockFilter
@Contract(value="_ -> this", mutates="this") PositionedRayTraceConfigurationBuilder blockFilter(Predicate<? super Block> blockFilter) Sets the current block filter when looking for block collisions.- Parameters:
blockFilter
- predicate for blocks the ray can potentially collide with- Returns:
- a reference to this object
-
targets
@Contract(value="_, _ -> this", mutates="this") PositionedRayTraceConfigurationBuilder targets(RayTraceTarget first, RayTraceTarget... others) Sets the targets for the rayTrace.- Parameters:
first
- the first targetothers
- the other targets- Returns:
- a reference to this object
-