Class BlockRay

java.lang.Object
com.andrei1058.bedwars.api.util.BlockRay
All Implemented Interfaces:
Iterator<org.bukkit.block.Block>

public class BlockRay extends Object implements Iterator<org.bukkit.block.Block>
  • Constructor Details

    • BlockRay

      public BlockRay(org.bukkit.World world, org.bukkit.util.Vector src, org.bukkit.util.Vector dst, double step)
      Constructs a BlockRay instance.
      Parameters:
      world - bukkit world to get the blocks from.
      src - the source vector (where we shoot the ray).
      dst - the destination vector.
      step - how frequent to check the ray (0.25 - 0.5 recommended).
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<org.bukkit.block.Block>
    • next

      public org.bukkit.block.Block next()
      This could return similar blocks multiple times.
      Specified by:
      next in interface Iterator<org.bukkit.block.Block>
      Returns:
      Current block at the ray's position.