Package me.deecaad.core.compatibility
Class HitBox
java.lang.Object
me.deecaad.core.compatibility.HitBox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVoxelShapePart(HitBox hitBox) booleancollides(org.bukkit.util.Vector point) Check whether point collides with this hitboxexpand(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).doubledoubledoubledoublegetDepth()doublestatic @Nullable HitBoxgetHitbox(@NotNull org.bukkit.block.Block block, boolean allowLiquid) static @Nullable HitBoxgetHitbox(@NotNull org.bukkit.entity.Entity entity) static @NotNull HitBoxgetHitbox(@NotNull org.bukkit.util.BoundingBox aabb) org.bukkit.util.VectorgetMax()doublegetMaxX()doublegetMaxY()doublegetMaxZ()org.bukkit.util.VectorgetMin()doublegetMinX()doublegetMinY()doublegetMinZ()doublegetWidth()grow(double amount) Grows this hit box in all directions with given amountgrow(double width, double height) modify(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) voidoutlineAllBoxes(org.bukkit.entity.Entity player) voidoutlineMainBox(org.bukkit.entity.Entity player, org.bukkit.Color color) booleanCheck whether other hitbox overlaps this onerayTrace(org.bukkit.util.Vector location, org.bukkit.util.Vector normalizedMotion) voidsetBlockHitBox(org.bukkit.block.Block block) voidsetLivingEntity(org.bukkit.entity.LivingEntity livingEntity)
-
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
-
setBlockHitBox
public void setBlockHitBox(org.bukkit.block.Block block) -
setLivingEntity
public void setLivingEntity(org.bukkit.entity.LivingEntity livingEntity) -
addVoxelShapePart
-
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
Check whether other hitbox overlaps this one- Parameters:
other- the other hitbox- Returns:
- true if overlaps
-
grow
Grows this hit box in all directions with given amount- Parameters:
amount- the amount to grow hit box- Returns:
- the grown hit box
-
grow
- Parameters:
width- the xz to grow hit boxheight- the y to grow hit box- Returns:
- the grown hit box
-
expand
Uses BoundingBox class method expand(Vector, double). Easier backwards compatibility this way. ...- Parameters:
direction- the direction to expandexpansion- 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 raynormalizedMotion- 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
-
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)
-