mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-26 19:07:40 +01:00
Collision API
This commit is contained in:
parent
e88a306a8c
commit
c44d007ade
@ -493,5 +493,15 @@ public interface RegionAccessor extends Keyed { // Paper
|
||||
* @return whether a line of sight exists between {@code from} and {@code to}
|
||||
*/
|
||||
public boolean lineOfSightExists(@NotNull Location from, @NotNull Location to);
|
||||
|
||||
/**
|
||||
* Checks if the world collides with the given boundingbox.
|
||||
* This will check for any colliding hard entities (boats, shulkers) / worldborder / blocks.
|
||||
* Does not load chunks that are within the bounding box.
|
||||
*
|
||||
* @param boundingBox the box to check collisions in
|
||||
* @return collides or not
|
||||
*/
|
||||
boolean hasCollisionsIn(@NotNull org.bukkit.util.BoundingBox boundingBox);
|
||||
// Paper end
|
||||
}
|
||||
|
@ -1023,4 +1023,26 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
*/
|
||||
boolean isInPowderedSnow();
|
||||
// Paper end
|
||||
|
||||
// Paper start - Collision API
|
||||
/**
|
||||
* Checks for any collisions with the entity's bounding box at the provided location.
|
||||
* This will check for any colliding entities (boats, shulkers) / worldborder / blocks.
|
||||
* Does not load chunks that are within the bounding box at the specified location.
|
||||
*
|
||||
* @param location the location to check collisions in
|
||||
* @return collides or not
|
||||
*/
|
||||
boolean collidesAt(@NotNull Location location);
|
||||
|
||||
/**
|
||||
* This checks using the given boundingbox as the entity's boundingbox if the entity would collide with anything.
|
||||
* This will check for any colliding entities (boats, shulkers) / worldborder / blocks.
|
||||
* Does not load chunks that are within the bounding box.
|
||||
*
|
||||
* @param boundingBox the box to check collisions in
|
||||
* @return collides or not
|
||||
*/
|
||||
boolean wouldCollideUsing(@NotNull BoundingBox boundingBox);
|
||||
// Paper end - Collision API
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user