Examples of toVector()


Examples of com.sk89q.worldedit.Vector2D.toVector()

                    throw new InsufficientArgumentsException("Invalid coordinates specified.");
                }
                int x = Integer.parseInt(coords[0]);
                int z = Integer.parseInt(coords[1]);
                Vector2D pos = new Vector2D(x, z);
                min2D = (args.hasFlag('c')) ? pos : ChunkStore.toChunk(pos.toVector());
            } else {
                // use player loc
                min2D = ChunkStore.toChunk(player.getBlockIn());
            }
View Full Code Here

Examples of com.sk89q.worldedit.util.Direction.toVector()

                if (hasDirection || hasLegacyDirection) {
                    int d = hasDirection ? tag.asInt("Direction") : MCDirections.fromLegacyHanging((byte) tag.asInt("Dir"));
                    Direction direction = MCDirections.fromHanging(d);

                    if (direction != null) {
                        Vector vector = transform.apply(direction.toVector()).subtract(transform.apply(Vector.ZERO)).normalize();
                        Direction newDirection = Direction.findClosest(vector, Flag.CARDINAL);

                        builder.putByte("Direction", (byte) MCDirections.toHanging(newDirection));
                        builder.putByte("Dir", MCDirections.toLegacyHanging(MCDirections.toHanging(newDirection)));
                    }
View Full Code Here

Examples of com.sk89q.worldedit.util.Location.toVector()

        // Create a proxy actor with a potentially different world for
        // making changes to the world
        Actor actor = createProxyActor(event.getCause());

        Location location = event.getLocation();
        Vector vector = location.toVector();

        // At this time, only handle interaction from players
        if (actor instanceof Player) {
            Player player = (Player) actor;
            LocalSession session = worldEdit.getSessionManager().get(actor);
View Full Code Here

Examples of com.sk89q.worldedit.util.Location.toVector()

                        return;
                    }

                    RegionSelector selector = session.getRegionSelector(player.getWorld());

                    if (selector.selectPrimary(location.toVector(), ActorSelectorLimits.forActor(player))) {
                        selector.explainPrimarySelection(actor, session, vector);
                    }

                    event.setCancelled(true);
                    return;
View Full Code Here

Examples of com.sk89q.worldedit.util.Location.toVector()

    @Override
    public boolean apply(Entity entity) throws WorldEditException {
        BaseEntity state = entity.getState();
        if (state != null) {
            Location location = entity.getLocation();
            Vector newPosition = transform.apply(location.toVector().subtract(from));
            Vector newDirection = transform.apply(location.getDirection()).subtract(transform.apply(Vector.ZERO)).normalize();
            Location newLocation = new Location(destination, newPosition.add(to), newDirection);

            // Some entities store their position data in NBT
            state = transformNbtData(state);
View Full Code Here

Examples of mikera.vectorz.util.VectorBuilder.toVector()

  @Test
  public void testVectorBuilder() {
    VectorBuilder vb = new VectorBuilder();

    assertEquals(Vector0.INSTANCE, vb.toVector());
    vb.append(1.0);
    assertEquals(Vector1.of(1.0), vb.toVector());
    vb.append(2.0);
    assertEquals(Vector2.of(1.0, 2.0), vb.toVector());
    vb.append(3.0);
View Full Code Here

Examples of mikera.vectorz.util.VectorBuilder.toVector()

  public void testVectorBuilder() {
    VectorBuilder vb = new VectorBuilder();

    assertEquals(Vector0.INSTANCE, vb.toVector());
    vb.append(1.0);
    assertEquals(Vector1.of(1.0), vb.toVector());
    vb.append(2.0);
    assertEquals(Vector2.of(1.0, 2.0), vb.toVector());
    vb.append(3.0);
    assertEquals(Vector3.of(1.0, 2.0, 3.0), vb.toVector());
    vb.append(4.0);
View Full Code Here

Examples of mikera.vectorz.util.VectorBuilder.toVector()

    assertEquals(Vector0.INSTANCE, vb.toVector());
    vb.append(1.0);
    assertEquals(Vector1.of(1.0), vb.toVector());
    vb.append(2.0);
    assertEquals(Vector2.of(1.0, 2.0), vb.toVector());
    vb.append(3.0);
    assertEquals(Vector3.of(1.0, 2.0, 3.0), vb.toVector());
    vb.append(4.0);
    assertEquals(Vector4.of(1.0, 2.0, 3.0, 4.0), vb.toVector());
    vb.append(5.0);
View Full Code Here

Examples of mikera.vectorz.util.VectorBuilder.toVector()

    vb.append(1.0);
    assertEquals(Vector1.of(1.0), vb.toVector());
    vb.append(2.0);
    assertEquals(Vector2.of(1.0, 2.0), vb.toVector());
    vb.append(3.0);
    assertEquals(Vector3.of(1.0, 2.0, 3.0), vb.toVector());
    vb.append(4.0);
    assertEquals(Vector4.of(1.0, 2.0, 3.0, 4.0), vb.toVector());
    vb.append(5.0);
    assertEquals(Vector.of(1.0, 2.0, 3.0, 4.0, 5.0), vb.toVector());
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorBuilder.toVector()

    vb.append(2.0);
    assertEquals(Vector2.of(1.0, 2.0), vb.toVector());
    vb.append(3.0);
    assertEquals(Vector3.of(1.0, 2.0, 3.0), vb.toVector());
    vb.append(4.0);
    assertEquals(Vector4.of(1.0, 2.0, 3.0, 4.0), vb.toVector());
    vb.append(5.0);
    assertEquals(Vector.of(1.0, 2.0, 3.0, 4.0, 5.0), vb.toVector());
  }

  @Test
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.