程序包 org.bukkit.util

类 BlockIterator

java.lang.Object
org.bukkit.util.BlockIterator
所有已实现的接口:
Iterator<Block>

public class BlockIterator extends Object implements Iterator<Block>
这个类执行射线追踪并迭代一条直线上的所有单个方块.

原文:This class performs ray tracing and iterates along blocks on a line

  • 构造器详细资料

    • BlockIterator

      public BlockIterator(World world, Vector start, Vector direction, double yOffset, int maxDistance)
      BlockIterator的构造函数.

      原文:Constructs the BlockIterator

      参数:
      world - 使用此追踪的世界
      start - 追踪的初位置向量
      direction - 追踪的方向向量
      yOffset - 垂直偏移量,追踪从初向量开始垂直偏移这个值的范围
      maxDistance - 这是在方块中追踪的最大距离, 设置此值在140以上可能导致未加载区块(unloaded chunks)的问题,值0表示无限制
    • BlockIterator

      public BlockIterator(Location loc, double yOffset, int maxDistance)
      BlockIterator的构造函数.

      原文:Constructs the BlockIterator

      参数:
      loc - 射线追踪的起始位置
      yOffset - 垂直偏移量,追踪从初向量开始垂直偏移这个值的范围
      maxDistance - 这是在方块中追踪的最大距离, 设置此值在140以上可能导致未加载区块(unloaded chunks)的问题,值0表示无限制
    • BlockIterator

      public BlockIterator(Location loc, double yOffset)
      BlockIterator的构造函数.

      原文:Constructs the BlockIterator.

      参数:
      loc - 射线追踪的开始位置
      yOffset - 垂直偏移量,追踪从初向量开始垂直偏移这个值的范围
    • BlockIterator

      public BlockIterator(Location loc)
      BlockIterator的构造函数.

      原文:Constructs the BlockIterator.

      参数:
      loc - 射线追踪的开始位置
    • BlockIterator

      public BlockIterator(LivingEntity entity, int maxDistance)
      BlockIterator的构造函数.

      原文:Constructs the BlockIterator.

      参数:
      entity - 被用来设置追踪的实体
      maxDistance - 这是在方块中追踪的最大距离, 设置此值在140以上可能导致未加载区块(unloaded chunks)的问题,值0表示无限制
    • BlockIterator

      public BlockIterator(LivingEntity entity)
      创建BlockIterator.

      原文:Constructs the BlockIterator.

      参数:
      entity - 被用来设置追踪的实体信息
  • 方法详细资料

    • hasNext

      public boolean hasNext()
      如果迭代器还有更多的元素则返回true.

      原文:Returns true if the iteration has more elements

      指定者:
      hasNext 在接口中 Iterator<Block>
    • next

      public Block next()
      返回追踪的下一个方块.

      原文:Returns the next Block in the trace

      指定者:
      next 在接口中 Iterator<Block>
      返回:
      追踪的下一个方块
    • remove

      public void remove()
      指定者:
      remove 在接口中 Iterator<Block>