Class HitBox

java.lang.Object
me.deecaad.core.compatibility.HitBox

public class HitBox extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    HitBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
     
    HitBox(org.bukkit.util.Vector start, org.bukkit.util.Vector end)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
     
    boolean
    collides(org.bukkit.util.Vector point)
    Check whether point collides with this hitbox
    expand(double negativeX, double negativeY, double negativeZ, double positiveX, double positiveY, double positiveZ)
    Uses BoundingBox class method expand(double, double, double, double, double, double).
    expand(org.bukkit.util.Vector direction, double expansion)
    Uses BoundingBox class method expand(Vector, double).
    double
     
    double
     
    double
     
    double
     
    double
     
    static @Nullable HitBox
    getHitbox(@NotNull org.bukkit.block.Block block, boolean allowLiquid)
     
    static @Nullable HitBox
    getHitbox(@NotNull org.bukkit.entity.Entity entity)
     
    static @NotNull HitBox
    getHitbox(@NotNull org.bukkit.util.BoundingBox aabb)
     
    org.bukkit.util.Vector
     
    double
     
    double
     
    double
     
    org.bukkit.util.Vector
     
    double
     
    double
     
    double
     
    double
     
    grow(double amount)
    Grows this hit box in all directions with given amount
    grow(double width, double height)
     
    modify(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
     
    void
    outlineAllBoxes(org.bukkit.entity.Entity player)
     
    void
    outlineMainBox(org.bukkit.entity.Entity player, org.bukkit.Color color)
     
    boolean
    Check whether other hitbox overlaps this one
    rayTrace(org.bukkit.util.Vector location, org.bukkit.util.Vector normalizedMotion)
     
    void
    setBlockHitBox(org.bukkit.block.Block block)
     
    void
    setLivingEntity(org.bukkit.entity.LivingEntity livingEntity)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HitBox

      public HitBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
    • HitBox

      public HitBox(org.bukkit.util.Vector start, org.bukkit.util.Vector end)
  • Method Details

    • modify

      public HitBox modify(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
    • setBlockHitBox

      public void setBlockHitBox(org.bukkit.block.Block block)
    • setLivingEntity

      public void setLivingEntity(org.bukkit.entity.LivingEntity livingEntity)
    • addVoxelShapePart

      public void addVoxelShapePart(HitBox hitBox)
    • getMinX

      public double getMinX()
    • getMinY

      public double getMinY()
    • getMinZ

      public double getMinZ()
    • getMaxX

      public double getMaxX()
    • getMaxY

      public double getMaxY()
    • getMaxZ

      public double getMaxZ()
    • getWidth

      public double getWidth()
    • getDepth

      public double getDepth()
    • getHeight

      public double getHeight()
    • getCenterX

      public double getCenterX()
    • getCenterY

      public double getCenterY()
    • getCenterZ

      public double getCenterZ()
    • getMin

      public org.bukkit.util.Vector getMin()
    • getMax

      public org.bukkit.util.Vector getMax()
    • collides

      public boolean collides(org.bukkit.util.Vector point)
      Check whether point collides with this hitbox
      Parameters:
      point - the point to check
      Returns:
      true if collides
    • overlaps

      public boolean overlaps(HitBox other)
      Check whether other hitbox overlaps this one
      Parameters:
      other - the other hitbox
      Returns:
      true if overlaps
    • grow

      public HitBox grow(double amount)
      Grows this hit box in all directions with given amount
      Parameters:
      amount - the amount to grow hit box
      Returns:
      the grown hit box
    • grow

      public HitBox grow(double width, double height)
      Parameters:
      width - the xz to grow hit box
      height - the y to grow hit box
      Returns:
      the grown hit box
    • expand

      public HitBox expand(org.bukkit.util.Vector direction, double expansion)
      Uses BoundingBox class method expand(Vector, double). Easier backwards compatibility this way. ...
      Parameters:
      direction - the direction to expand
      expansion - the amount to expand
      Returns:
      this hit box with expansion
    • expand

      public HitBox expand(double negativeX, double negativeY, double negativeZ, double positiveX, double positiveY, double positiveZ)
      Uses BoundingBox class method expand(double, double, double, double, double, double). Easier backwards compatibility this way. ...
      Returns:
      this hit box with expansion
    • rayTrace

      public RayTraceResult rayTrace(org.bukkit.util.Vector location, org.bukkit.util.Vector normalizedMotion)
      Parameters:
      location - the start location of ray
      normalizedMotion - the normalized direction
      Returns:
      the ray trace result or null if there is no hit
    • outlineAllBoxes

      public void outlineAllBoxes(org.bukkit.entity.Entity player)
    • outlineMainBox

      public void outlineMainBox(org.bukkit.entity.Entity player, org.bukkit.Color color)
    • cloneDimensions

      public HitBox cloneDimensions()
    • getHitbox

      @Nullable public static @Nullable HitBox getHitbox(@NotNull @NotNull org.bukkit.entity.Entity entity)
    • getHitbox

      @Nullable public static @Nullable HitBox getHitbox(@NotNull @NotNull org.bukkit.block.Block block, boolean allowLiquid)
    • getHitbox

      @NotNull public static @NotNull HitBox getHitbox(@NotNull @NotNull org.bukkit.util.BoundingBox aabb)