Package org.spout.api.util

Examples of org.spout.api.util.BlockIterator


    if (block.getMaterial().equals(VanillaMaterials.VINES) && cause instanceof EntityCause) {
      //get block by block tracing from the player view
      Entity entity = ((EntityCause) cause).getSource();
      EntityHead head = entity.get(EntityHead.class);
      if (head != null) {
        BlockIterator iter = head.getBlockView();
        Block next;
        while (iter.hasNext()) {
          next = iter.next();
          if (next.equals(block)) {
            Block target = iter.hasNext() ? iter.next() : null;
            if (target != null) {
              //get what face this target is relative to the main block
              for (BlockFace face : BlockFaces.NESWBT) {
                if (block.translate(face).equals(target)) {
                  return face;
View Full Code Here


   *
   * @param maxDistance the blocks can be iterated
   * @return Block iterator
   */
  public BlockIterator getBlockView(int maxDistance) {
    return new BlockIterator(getOwner().getWorld(), getHeadTransform(), maxDistance);
  }
View Full Code Here

TOP

Related Classes of org.spout.api.util.BlockIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.