Class BlockBox

java.lang.Object
me.hsgamer.hscore.minecraft.block.box.BlockBox

public class BlockBox extends Object
A custom box to bound blocks
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final boolean
    Whether it should include the maximum coordinate
    final int
    The maximum x coordinate
    final int
    The maximum y coordinate
    final int
    The maximum z coordinate
    final int
    The minimum x coordinate
    final int
    The minimum y coordinate
    final int
    The minimum z coordinate
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockBox(int x1, int y1, int z1, int x2, int y2, int z2, boolean maxInclusive)
    Create a new block box
    BlockBox(Position pos1, Position pos2, boolean maxInclusive)
    Create a new block box
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(double x, double y, double z)
    Check if the location is in the box
    boolean
    Check if the location is in the box

    Methods inherited from class java.lang.Object

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

    • minX

      public final int minX
      The minimum x coordinate
    • minY

      public final int minY
      The minimum y coordinate
    • minZ

      public final int minZ
      The minimum z coordinate
    • maxX

      public final int maxX
      The maximum x coordinate
    • maxY

      public final int maxY
      The maximum y coordinate
    • maxZ

      public final int maxZ
      The maximum z coordinate
    • maxInclusive

      public final boolean maxInclusive
      Whether it should include the maximum coordinate
  • Constructor Details

    • BlockBox

      public BlockBox(int x1, int y1, int z1, int x2, int y2, int z2, boolean maxInclusive)
      Create a new block box
      Parameters:
      x1 - the first x
      y1 - the first y
      z1 - the first z
      x2 - the second x
      y2 - the second y
      z2 - the second z
      maxInclusive - true if it should include the maximum location
    • BlockBox

      public BlockBox(Position pos1, Position pos2, boolean maxInclusive)
      Create a new block box
      Parameters:
      pos1 - the first vector
      pos2 - the second vector
      maxInclusive - true if it should include the maximum location
  • Method Details

    • contains

      public boolean contains(double x, double y, double z)
      Check if the location is in the box
      Parameters:
      x - the x
      y - the y
      z - the z
      Returns:
      true if it is in the box
    • contains

      public boolean contains(Position pos)
      Check if the location is in the box
      Parameters:
      pos - the position
      Returns:
      true if it is in the box