當前位置: 首頁>>代碼示例>>Java>>正文


Java Vector.getBlockY方法代碼示例

本文整理匯總了Java中com.sk89q.worldedit.Vector.getBlockY方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector.getBlockY方法的具體用法?Java Vector.getBlockY怎麽用?Java Vector.getBlockY使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sk89q.worldedit.Vector的用法示例。


在下文中一共展示了Vector.getBlockY方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getChunkCubes

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public Set<Vector> getChunkCubes() {
    Set chunks = new LocalBlockVectorSet();

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

    for (int x = max.getBlockX() >> ChunkStore.CHUNK_SHIFTS; x >= min.getBlockX() >> ChunkStore.CHUNK_SHIFTS; --x) {
        for (int z = max.getBlockZ() >> ChunkStore.CHUNK_SHIFTS; z >= min.getBlockZ() >> ChunkStore.CHUNK_SHIFTS; --z) {
            for (int y = max.getBlockY() >> ChunkStore.CHUNK_SHIFTS; y >= min.getBlockY() >> ChunkStore.CHUNK_SHIFTS; --y) {
                chunks.add(new Vector(x, y, z));
            }
        }
    }

    return chunks;
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:18,代碼來源:CuboidRegion.java

示例2: explainSecondarySelection

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public void explainSecondarySelection(Actor player, LocalSession session, Vector pos) {
    checkNotNull(player);
    checkNotNull(session);
    checkNotNull(pos);

    Message msg;
    if (position1 != null && position2 != null) {
        msg = BBC.SELECTOR_POS.m(2, position2, region.getArea());
    } else {
        msg = BBC.SELECTOR_POS.m(2, position2, "");
    }
    String prefix = WorldEdit.getInstance().getConfiguration().noDoubleSlash ? "" : "/";
    String cmd = prefix + Commands.getAlias(SelectionCommands.class, "/pos2") + " " + pos.getBlockX() + "," + pos.getBlockY() + "," + pos.getBlockZ();
    msg.suggestTip(cmd).send(player);

    session.dispatchCUIEvent(player, new SelectionPointEvent(1, pos, getArea()));
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:19,代碼來源:CuboidRegionSelector.java

示例3: setDimensions

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public void setDimensions(Vector dimensions) {
    width = dimensions.getBlockX();
    height = dimensions.getBlockY();
    length = dimensions.getBlockZ();
    area = width * length;
    int newVolume = area * height;
    if (newVolume != volume) {
        volume = newVolume;
        ids = new byte[1 + (volume >> BLOCK_SHIFT)][];
        datas = new byte[1 + (volume >> BLOCK_SHIFT)][];
        lastAddI = -1;
        lastIdsI = -1;
        lastDatasI = -1;
        saveIds = false;
        saveAdd = false;
        saveDatas = false;
    }
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:20,代碼來源:MemoryOptimizedClipboard.java

示例4: adjacentAir

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
public boolean adjacentAir(Vector v) {
    int x = v.getBlockX();
    int y = v.getBlockY();
    int z = v.getBlockZ();
    if (!mask.test(x + 1, y, z)) {
        return true;
    }
    if (!mask.test(x - 1, y, z)) {
        return true;
    }
    if (!mask.test(x, y, z + 1)) {
        return true;
    }
    if (!mask.test(x, y, z - 1)) {
        return true;
    }
    if (y < 255 && !mask.test(x, y + 1, z)) {
        return true;
    }
    if (y > 0 && !mask.test(x, y - 1, z)) {
        return true;
    }
    return false;
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:25,代碼來源:AngleMask.java

示例5: placeBuildPlan2D

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
/**Places the given material where the plan is true, starting from the given relative origin within this module.
 * The plan and origin are rotated beforehand, to avoid conversion toGlobal for each block!
 * @param origin	A relative coordinate specifying the minimum Point of the given build plan
 * @param plan		A grid of boolean values. Material is set if true at that position.
 * @param m			The Material to be placed.
 * @param height	How high the plan should be duplicated. (stacked up)
 */
public void placeBuildPlan2D(Vector origin, boolean[][] plan, Material m, int height) {
	plan = Helper.rotateBoolMatrixClockw(plan, turnedBy); //clockwise turning as is defined in mc for sky directions
	// The origin has to be at another corner of the matrix now:
	origin = toGlobal(origin);
	switch (turnedBy) {
	case 0:
		break;
	case 90:
		origin = origin.add(-(plan.length-1), 0, 0);
		break;
	case 180:
		origin = origin.add(-(plan.length-1),0,-(plan[0].length-1));
		break;
	case 270:
		origin = origin.add(0, 0, -(plan[0].length-1));
		break;
	default:
		parent.setStateAndNotify(State.ERROR, "Module: turnedBy is out of range: " + turnedBy + ". Plan is not placed.");
		return;
	}
	
	// now we have a building plan matrix looking east, with the origin in the lower left. Easy:
	int x = origin.getBlockX();
	for (int row=0; row < plan.length; row++, x++) {
		int z = origin.getBlockZ();
		for (int col=0; col< plan[0].length; col++, z++)
			for (int y = origin.getBlockY(); y < (origin.getBlockY()+height); y++)
				if (plan[row][col]) parent.world.getBlockAt(x,y,z).setType(m);	
	}
		
}
 
開發者ID:TheRoot89,項目名稱:DungeonGen,代碼行數:39,代碼來源:Module.java

示例6: getIntDirections

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
private IntegerTrio[] getIntDirections() {
    IntegerTrio[] array = new IntegerTrio[directions.size()];
    for (int i = 0; i < array.length; i++) {
        Vector dir = directions.get(i);
        array[i] = new IntegerTrio(dir.getBlockX(), dir.getBlockY(), dir.getBlockZ());
    }
    return array;
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:9,代碼來源:DFSVisitor.java

示例7: setDimensions

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
public void setDimensions(Vector pos1, Vector pos2) {
    this.minX = pos1.getBlockX();
    this.minY = pos1.getBlockY();
    this.minZ = pos1.getBlockZ();
    this.maxX = pos2.getBlockX();
    this.maxY = pos2.getBlockY();
    this.maxZ = pos2.getBlockZ();
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:9,代碼來源:RollbackOptimizedHistory.java

示例8: apply

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public boolean apply(Extent extent, Vector set, Vector get) throws WorldEditException {
    if (set.getBlockX() == get.getBlockX() && set.getBlockZ() == get.getBlockZ() && set.getBlockY() == get.getBlockY()) {
        return false;
    }
    return extent.setBlock(set, extent.getBlock(get));
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:8,代碼來源:ExistingPattern.java

示例9: apply

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public BaseBlock apply(Vector position) {
    int index = (position.getBlockX() + position.getBlockY() + position.getBlockZ()) % patternsArray.length;
    if (index < 0) {
        index += patternsArray.length;
    }
    return patternsArray[index].apply(position);
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:9,代碼來源:Linear3DBlockPattern.java

示例10: getBlock

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public BaseBlock getBlock(Vector position) {
    if (region.contains(position)) {
        int x = position.getBlockX() - mx;
        int y = position.getBlockY() - my;
        int z = position.getBlockZ() - mz;
        return IMP.getBlock(x, y, z);
    }
    return EditSession.nullBlock;
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:11,代碼來源:BlockArrayClipboard.java

示例11: setRadius

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
/**
 * Set the radii.
 *
 * @param radius the radius
 */
public void setRadius(Vector radius) {
    this.radius = new MutableBlockVector(radius.add(0.5, 0.5, 0.5));
    radiusSqr = new MutableBlockVector(radius.multiply(radius));
    radiusLengthSqr = radiusSqr.getBlockX();
    if (radius.getBlockY() == radius.getBlockX() && radius.getBlockX() == radius.getBlockZ()) {
        this.sphere = true;
    } else {
        this.sphere = false;
    }
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:16,代碼來源:EllipsoidRegion.java

示例12: setBlock

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public boolean setBlock(Vector pos, BaseBlock block) throws WorldEditException {
    int x = pos.getBlockX() + random.nextInt(1 + (dx << 1)) - dx;
    int y = pos.getBlockY() + random.nextInt(1 + (dy << 1)) - dy;
    int z = pos.getBlockZ() + random.nextInt(1 + (dz << 1)) - dz;
    return getExtent().setBlock(x, y, z, block);
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:8,代碼來源:RandomOffsetTransform.java

示例13: Triangle

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
public Triangle(Vector pos1, Vector pos2, Vector pos3) {
    verts[0] = new double[]{pos1.getBlockX(), pos1.getBlockY(), pos1.getBlockZ()};
    verts[1] = new double[]{pos2.getBlockX(), pos2.getBlockY(), pos2.getBlockZ()};
    verts[2] = new double[]{pos3.getBlockX(), pos3.getBlockY(), pos3.getBlockZ()};
    radius[0] = RADIUS;
    radius[1] = RADIUS;
    radius[2] = RADIUS;
    this.normalVec = pos2.subtract(pos1).cross(pos3.subtract(pos1)).normalize();
    this.b = Math.max(Math.max(this.normalVec.dot(pos1), this.normalVec.dot(pos2)), this.normalVec.dot(pos3));
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:11,代碼來源:Triangle.java

示例14: ClipboardPattern

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
/**
 * Create a new clipboard pattern.
 *
 * @param clipboard the clipboard
 */
public ClipboardPattern(Clipboard clipboard) {
    checkNotNull(clipboard);
    this.clipboard = clipboard;
    Vector size = clipboard.getMaximumPoint().subtract(clipboard.getMinimumPoint()).add(1, 1, 1);
    this.sx = size.getBlockX();
    this.sy = size.getBlockY();
    this.sz = size.getBlockZ();
    this.min = clipboard.getMinimumPoint();
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:15,代碼來源:ClipboardPattern.java

示例15: visit

import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
public void visit(final Vector pos) {
    Node node = new Node(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
    if (!this.hashQueue.contains(node)) {
        isVisitable(pos, pos); // Ignore this, just to initialize mask on this point
        queue.addFirst(new NodePair(null, node, 0));
        hashQueue.add(node);
    }
}
 
開發者ID:boy0001,項目名稱:FastAsyncWorldedit,代碼行數:9,代碼來源:DFSVisitor.java


注:本文中的com.sk89q.worldedit.Vector.getBlockY方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。