当前位置: 首页>>代码示例>>Java>>正文


Java Vector.getY方法代码示例

本文整理汇总了Java中com.sk89q.worldedit.Vector.getY方法的典型用法代码示例。如果您正苦于以下问题:Java Vector.getY方法的具体用法?Java Vector.getY怎么用?Java Vector.getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sk89q.worldedit.Vector的用法示例。


在下文中一共展示了Vector.getY方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setBlock

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
@Override
public boolean setBlock(Vector location, BaseBlock block) throws WorldEditException {
    boolean result = false;
    Vector pos = getPos(location);
    double sx = pos.getX();
    double sy = pos.getY();
    double sz = pos.getZ();
    double ex = sx + dx;
    double ey = Math.min(maxy, sy + dy);
    double ez = sz + dz;
    for (pos.mutY(sy); pos.getY() < ey; pos.mutY(pos.getY() + 1)) {
        for (pos.mutZ(sz); pos.getZ() < ez; pos.mutZ(pos.getZ() + 1)) {
            for (pos.mutX(sx); pos.getX() < ex; pos.mutX(pos.getX() + 1)) {
                result |= super.setBlock(pos, block);
            }
        }
    }
    return result;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:20,代码来源:ScaleTransform.java

示例2: getVertex

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
public static Vector getVertex(Vector pos1, Vector pos2, double lenPercent) {
    if (lenPercent <= 1) return Vector.getMidpoint(pos1, pos2);
    double curveLen = pos1.distance(pos2) * lenPercent;
    double dy = pos2.getY() - pos1.getY();
    double dx = pos2.getX() - pos1.getX();
    double dz = pos2.getZ() - pos1.getZ();
    double dh = Math.sqrt(dx * dx + dz * dz);
    double g = Math.sqrt(curveLen * curveLen - dy * dy) / 2;
    double a = 0.00001;
    for (;g < a * Math.sinh(dh/(2 * a)); a *= 1.00001);
    double vertX = (dh-a*Math.log((curveLen + dy)/(curveLen - dy)))/2.0;
    double z = (dh/2)/a;
    double oY = (dy - curveLen * (Math.cosh(z) / Math.sinh(z))) / 2;
    double vertY = a * 1 + oY;
    return pos1.add(pos2.subtract(pos1).multiply(vertX / dh).add(0, vertY, 0)).round();
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:17,代码来源:CatenaryBrush.java

示例3: ArbitraryShape

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
public ArbitraryShape(Region extent) {
    this.extent = extent;

    Vector min = extent.getMinimumPoint();
    Vector max = extent.getMaximumPoint();

    cacheOffsetX = min.getBlockX() - 1;
    cacheOffsetY = min.getBlockY() - 1;
    cacheOffsetZ = min.getBlockZ() - 1;

    cacheSizeX = (int) (max.getX() - cacheOffsetX + 2);
    cacheSizeY = (int) (max.getY() - cacheOffsetY + 2);
    cacheSizeZ = (int) (max.getZ() - cacheOffsetZ + 2);

    cache = new short[cacheSizeX * cacheSizeY * cacheSizeZ];
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:17,代码来源:ArbitraryShape.java

示例4: getFaces

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
/**
 * Get a region that contains the faces of this cuboid.
 *
 * @return a new complex region
 */
public Region getFaces() {
    Vector min = getMinimumPoint();
    Vector max = getMaximumPoint();

    return new RegionIntersection(
            // Project to Z-Y plane
            new CuboidRegion(new Vector(min.getX(), pos1.getY(), pos1.getZ()), new Vector(min.getX(), pos2.getY(), pos2.getZ())),
            new CuboidRegion(new Vector(max.getX(), pos1.getY(), pos1.getZ()), new Vector(max.getX(), pos2.getY(), pos2.getZ())),

            // Project to X-Y plane
            new CuboidRegion(new Vector(pos1.getX(), pos1.getY(), min.getZ()), new Vector(pos2.getX(), pos2.getY(), min.getZ())),
            new CuboidRegion(new Vector(pos1.getX(), pos1.getY(), max.getZ()), new Vector(pos2.getX(), pos2.getY(), max.getZ())),

            // Project to the X-Z plane
            new CuboidRegion(new Vector(pos1.getX(), min.getY(), pos1.getZ()), new Vector(pos2.getX(), min.getY(), pos2.getZ())),
            new CuboidRegion(new Vector(pos1.getX(), max.getY(), pos1.getZ()), new Vector(pos2.getX(), max.getY(), pos2.getZ())));
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:23,代码来源:CuboidRegion.java

示例5: setPosition

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
@Override
public void setPosition(Vector pos, float pitch, float yaw) {
    org.spongepowered.api.world.Location<World> loc = new org.spongepowered.api.world.Location<>(
            this.player.getWorld(), pos.getX(), pos.getY(), pos.getZ()
    );

    this.player.setLocationAndRotation(loc, new Vector3d(pitch, yaw, 0));
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:9,代码来源:SpongePlayer.java

示例6: adapt

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
private static org.bukkit.Location adapt(org.bukkit.World world, Vector position) {
    checkNotNull(world);
    checkNotNull(position);
    return new org.bukkit.Location(
            world,
            position.getX(), position.getY(), position.getZ());
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:8,代码来源:BukkitWorld.java

示例7: getBlock

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
public static BaseBlock getBlock(Level level, Vector position) {
    Vector3 pos = new Vector3(position.getX(), position.getY(), position.getZ());
    Block block = level.getBlock(pos);
    int id = block.getId();
    int data = block.getDamage();
    return new BaseBlock(id, data);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:8,代码来源:NukkitUtil.java

示例8: getBlock

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
@Override
public BaseBlock getBlock(Vector position) {
    BaseBlock tmp = pattern.apply(position);
    if (position == target || (position.getX() == target.getX() && position.getY() == target.getY() && position.getZ() == target.getZ())) {
        block = tmp;
    } else {
        block = null;
    }
    return tmp;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:11,代码来源:PatternExtent.java

示例9: getBlock

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
@Override
public BaseBlock getBlock(Vector position) {
    if (position.getX() == x && position.getY() == y && position.getZ() == z) {
        return block;
    }
    return super.getBlock(position);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:8,代码来源:TemporalExtent.java

示例10: getLazyBlock

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
@Override
public BaseBlock getLazyBlock(Vector position) {
    if (position.getX() == x && position.getY() == y && position.getZ() == z) {
        return block;
    }
    return super.getLazyBlock(position);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:8,代码来源:TemporalExtent.java

示例11: test

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
@Override
public boolean test(Vector v) {
    int count = 0;
    double x = v.getX();
    double y = v.getY();
    double z = v.getZ();
    v.mutX(x + 1);
    if (mask.test(v) && ++count == min && max >= 8) {
        v.mutX(x);
        return true;
    }
    v.mutX(x - 1);
    if (mask.test(v) && ++count == min && max >= 8) {
        v.mutX(x);
        return true;
    }
    v.mutX(x);
    v.mutZ(z + 1);
    if (mask.test(v) && ++count == min && max >= 8) {
        v.mutZ(z);
        return true;
    }
    v.mutZ(z - 1);
    if (mask.test(v) && ++count == min && max >= 8) {
        v.mutZ(z);
        return true;
    }
    v.mutZ(z);
    return count >= min && count <= max;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:31,代码来源:WallMask.java

示例12: any90Rotate

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
private Vector any90Rotate(Vector normal) {
    normal = normal.normalize();
    if (normal.getX() == 1 || normal.getY() == 1 || normal.getZ() == 1) {
        return new Vector(normal.getZ(), normal.getX(), normal.getY());
    }
    AffineTransform affine = new AffineTransform();
    affine = affine.rotateX(90);
    affine = affine.rotateY(90);
    affine = affine.rotateZ(90);
    Vector random = affine.apply(normal);
    return random.cross(normal).normalize();
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:13,代码来源:CircleBrush.java

示例13: setMutable

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
private Vector3 setMutable(Vector pt) {
    mutable.x = pt.getX();
    mutable.y = pt.getY();
    mutable.z = pt.getZ();
    return mutable;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:7,代码来源:NukkitWorld.java

示例14: toLocation

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
public static cn.nukkit.level.Location toLocation(Level world, Vector pt) {
    return new cn.nukkit.level.Location(pt.getX(), pt.getY(), pt.getZ(), 0, 0, world);
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:4,代码来源:NukkitUtil.java

示例15: test

import com.sk89q.worldedit.Vector; //导入方法依赖的package包/类
@Override
public boolean test(Vector v) {
    int count = 0;
    double x = v.getX();
    double y = v.getY();
    double z = v.getZ();
    v.mutX(x + 1);
    if (mask.test(v) && ++count == min && max >= 8) {
        v.mutX(x);
        return true;
    }
    v.mutX(x - 1);
    if (mask.test(v) && ++count == min && max >= 8) {
        v.mutX(x);
        return true;
    }
    v.mutX(x);
    v.mutY(y + 1);
    if (mask.test(v) && ++count == min && max >= 8) {
        v.mutY(y);
        return true;
    }
    v.mutY(y - 1);
    if (mask.test(v) && ++count == min && max >= 8) {
        v.mutY(y);
        return true;
    }
    v.mutY(y);
    v.mutZ(z + 1);
    if (mask.test(v) && ++count == min && max >= 8) {
        v.mutZ(z);
        return true;
    }
    v.mutZ(z - 1);
    if (mask.test(v) && ++count == min && max >= 8) {
        v.mutZ(z);
        return true;
    }
    v.mutZ(z);
    return count >= min && count <= max;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:42,代码来源:AdjacentMask.java


注:本文中的com.sk89q.worldedit.Vector.getY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。