java.lang.Object
com.portingdeadmods.portingdeadlibs.utils.AABBUtils

public final class AABBUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.world.phys.AABB
    create(double left, double right, double down, double up, double front, double back, double x, double y, double z)
    Creates an AABB starting from a point, then inflates it by the given amounts in every direction.
    static net.minecraft.world.phys.AABB
    create(double left, double right, double down, double up, double front, double back, net.minecraft.core.BlockPos pos)
    Creates an AABB starting from a 1x1x1 cube at the given position, then inflates it by the given amounts in every direction.
    static UniqueArray<net.minecraft.core.BlockPos>
    getAllPositionsInAABB(net.minecraft.world.phys.AABB aabb)
    Returns a UniqueArray of all full blocks occupied by the given AABB.
    static net.minecraft.world.phys.AABB
    move(net.minecraft.world.phys.AABB aabb, net.minecraft.core.Direction direction, double distance)
    Moves the given AABB in the specified direction by the specified distance.

    Methods inherited from class java.lang.Object

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

    • AABBUtils

      public AABBUtils()
  • Method Details

    • move

      public static net.minecraft.world.phys.AABB move(net.minecraft.world.phys.AABB aabb, net.minecraft.core.Direction direction, double distance)
      Moves the given AABB in the specified direction by the specified distance.
      Parameters:
      aabb - The AABB to move.
      direction - The Direction to move the AABB in.
      distance - The distance to move the AABB.
      Returns:
      The moved AABB.
    • create

      public static net.minecraft.world.phys.AABB create(double left, double right, double down, double up, double front, double back, double x, double y, double z)
      Creates an AABB starting from a point, then inflates it by the given amounts in every direction.
      Parameters:
      left - The amount to inflate the AABB to the left.
      right - The amount to inflate the AABB to the right.
      down - The amount to inflate the AABB downwards.
      up - The amount to inflate the AABB upwards.
      front - The amount to inflate the AABB towards the front.
      back - The amount to inflate the AABB towards the back.
      x - The x position to create the AABB at.
      y - The y position to create the AABB at.
      z - The z position to create the AABB at.
      Returns:
      The resulting AABB
    • create

      public static net.minecraft.world.phys.AABB create(double left, double right, double down, double up, double front, double back, net.minecraft.core.BlockPos pos)
      Creates an AABB starting from a 1x1x1 cube at the given position, then inflates it by the given amounts in every direction.
      Parameters:
      left - The amount to inflate the AABB to the left.
      right - The amount to inflate the AABB to the right.
      down - The amount to inflate the AABB downwards.
      up - The amount to inflate the AABB upwards.
      front - The amount to inflate the AABB towards the front.
      back - The amount to inflate the AABB towards the back.
      pos - The position to create the AABB at.
      Returns:
      The resulting AABB
    • getAllPositionsInAABB

      public static UniqueArray<net.minecraft.core.BlockPos> getAllPositionsInAABB(net.minecraft.world.phys.AABB aabb)
      Returns a UniqueArray of all full blocks occupied by the given AABB.
      Parameters:
      aabb - The AABB to get the positions from.
      Returns:
      A UniqueArray of BlockPos representing all full blocks within the AABB.