Class Cuboid

java.lang.Object
com.storytimeproductions.models.stgames.Cuboid

public class Cuboid extends Object
Represents a 3D cuboid defined by two opposite corners in a Minecraft world. This class provides methods to check if a given location is within the cuboid.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final org.bukkit.World
     
    final int
     
    final int
     
    final int
     
    final int
     
    final int
     
    final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Cuboid(org.bukkit.World world, int x1, int y1, int z1, int x2, int y2, int z2)
    Constructs a Cuboid with the specified world and corner coordinates.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(org.bukkit.Location loc)
    Checks if the specified location is within this cuboid.
    List<org.bukkit.Location>
    Returns a list of all block locations within this cuboid.

    Methods inherited from class Object

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

    • world

      public final org.bukkit.World world
    • x1

      public final int x1
    • y1

      public final int y1
    • z1

      public final int z1
    • x2

      public final int x2
    • y2

      public final int y2
    • z2

      public final int z2
  • Constructor Details

    • Cuboid

      public Cuboid(org.bukkit.World world, int x1, int y1, int z1, int x2, int y2, int z2)
      Constructs a Cuboid with the specified world and corner coordinates.
      Parameters:
      world - The world in which the cuboid exists.
      x1 - The x-coordinate of one corner.
      y1 - The y-coordinate of one corner.
      z1 - The z-coordinate of one corner.
      x2 - The x-coordinate of the opposite corner.
      y2 - The y-coordinate of the opposite corner.
      z2 - The z-coordinate of the opposite corner.
  • Method Details

    • contains

      public boolean contains(org.bukkit.Location loc)
      Checks if the specified location is within this cuboid.
      Parameters:
      loc - The location to check.
      Returns:
      true if the location is within the cuboid, false otherwise.
    • getLocations

      public List<org.bukkit.Location> getLocations()
      Returns a list of all block locations within this cuboid.
      Returns:
      List of Locations inside the cuboid.