Package org.spout.api.geo.discrete

Examples of org.spout.api.geo.discrete.Point


  private int lastY = Integer.MIN_VALUE;

  @Override
  public void finalizeRun(Transform live) {
    Point currentPosition = live.getPosition();
    int y = currentPosition.getBlockY();

    if (y != lastY) {

      lastY = y;
      int cY = getRepositionManager().convertY(y);
View Full Code Here


    if (!(entity instanceof Player) || type != Action.RIGHT_CLICK || face == BlockFace.BOTTOM || face == BlockFace.THIS || face == BlockFace.TOP) {
      return;
    }

    World world = block.getWorld();
    Point pos = block.getPosition();
    Entity e = world.createEntity(new Point(world, pos.getBlockX(), pos.getBlockY(), pos.getBlockZ()), ItemFrame.class);
    ItemFrame frame = e.add(ItemFrame.class);
    frame.setOrientation(face);
    world.spawnEntity(e);
  }
View Full Code Here

    } else {
      return false;
    }
    boolean shouldD = super.onDestroy(block, cause);
    if (shouldD) {
      Point position = block.getPosition();
      for (ItemStack item : inventory) {
        if (item == null) {
          continue;
        }
        Item.dropNaturally(position, item);
View Full Code Here

  @Override
  public boolean onDestroy(Block block, Cause<?> cause) {
    Inventory inventory = block.get(Chest.class).getInventory();
    boolean shouldD = super.onDestroy(block, cause);
    if (shouldD) {
      Point position = block.getPosition();
      for (ItemStack item : inventory) {
        if (item == null) {
          continue;
        }
        Item.dropNaturally(position, item);
View Full Code Here

    Player player = (Player) source;
    if (!(player.getPhysics().getPosition().getWorld().getGenerator() instanceof BiomeGenerator)) {
      throw new CommandException("This map does not appear to have any biome data.");
    }
    Point pos = player.getPhysics().getPosition();
    Biome biome = pos.getWorld().getBiome(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
    source.sendMessage(plugin.getPrefix() + ChatStyle.GREEN + "Current biome: " + ChatStyle.WHITE + (biome != null ? biome.getName() : "none"));
  }
View Full Code Here

      final int x = random.nextInt(256) - 127 + shift;
      final int z = random.nextInt(256) - 127;
      final int y = getHighestSolidBlock(world, x, z);
      if (y != -1 && !LogicUtil.equalsAny(world.getBiome(x, y, z),
          VanillaBiomes.MUSHROOM_SHORE, VanillaBiomes.MUSHROOM)) {
        return new Point(world, x, y + 0.5f, z);
      }
    }
    return new Point(world, shift, 80, 0);
  }
View Full Code Here

        }
      }
    }
    w.setBlockMaterial(x, y + totalHeight, z, crystalBase, (short) 0, null);
    if (spawnEnderCrystal) {
      w.createAndSpawnEntity(new Point(w, x + 0.5f, y + totalHeight, z + 0.5f), LoadOption.NO_LOAD, EnderCrystal.class);
    }
  }
View Full Code Here

  }

  @Override
  public void onCollided(EntityCollideEvent event) {
    //TODO: Hit entities with splash
    GeneralEffects.SPLASHPOTION.playGlobal(new Point(event.getContactInfo().getNormal(), getOwner().getWorld()), getPotion().getData());
    getOwner().remove();
  }
View Full Code Here

    if (temple == null) {
      return;
    }
    final BoundingBox boundingBox = temple.getBoundingBox();
    y = getAverageHeight(w, x, z, (int) boundingBox.getXSize(), (int) boundingBox.getZSize());
    temple.setPosition(new Point(w, x, y, z));
    temple.setRotation(Quaternionf.fromAngleDegAxis(random.nextInt(4) * 90, 0, 1, 0));
    if (temple.canPlace()) {
      temple.place();
    }
  }
View Full Code Here

  public void placeObject(World w, int x, int y, int z) {
    final Set<BoundingBox> placed = new HashSet<BoundingBox>();
    final Queue<StructurePiece> activeBranches = new LinkedList<StructurePiece>();
    final Map<StructurePiece, BoundingBox> lastBoxes = new HashMap<StructurePiece, BoundingBox>();
    final MineshaftRoom room = new MineshaftRoom(this);
    room.setPosition(new Point(w, x, y, z));
    room.randomize();
    activeBranches.add(room);
    final byte size = (byte) (random.nextInt(MAX_SIZE_RAND + 1) + MAX_SIZE_BASE);
    byte count = 0;
    while (!activeBranches.isEmpty()) {
View Full Code Here

TOP

Related Classes of org.spout.api.geo.discrete.Point

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.