本文整理匯總了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;
}
示例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()));
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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();
}
示例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));
}
示例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);
}
示例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;
}
示例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;
}
}
示例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);
}
示例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));
}
示例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();
}
示例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);
}
}