本文整理汇总了Java中com.sk89q.worldedit.world.World.getMaxY方法的典型用法代码示例。如果您正苦于以下问题:Java World.getMaxY方法的具体用法?Java World.getMaxY怎么用?Java World.getMaxY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sk89q.worldedit.world.World
的用法示例。
在下文中一共展示了World.getMaxY方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ascendUpwards
import com.sk89q.worldedit.world.World; //导入方法依赖的package包/类
@Override
public boolean ascendUpwards(int distance, boolean alwaysGlass) {
final Vector pos = getBlockIn();
final int x = pos.getBlockX();
final int initialY = Math.max(0, pos.getBlockY());
int y = Math.max(0, pos.getBlockY() + 1);
final int z = pos.getBlockZ();
final int maxY = Math.min(getWorld().getMaxY() + 1, initialY + distance);
final World world = getPosition().getWorld();
while (y <= world.getMaxY() + 2) {
if (!BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) {
break; // Hit something
} else if (y > maxY + 1) {
break;
} else if (y == maxY + 1) {
floatAt(x, y - 1, z, alwaysGlass);
return true;
}
++y;
}
return false;
}
示例2: ascendToCeiling
import com.sk89q.worldedit.world.World; //导入方法依赖的package包/类
@Override
public boolean ascendToCeiling(int clearance, boolean alwaysGlass) {
Vector pos = getBlockIn();
int x = pos.getBlockX();
int initialY = Math.max(0, pos.getBlockY());
int y = Math.max(0, pos.getBlockY() + 2);
int z = pos.getBlockZ();
World world = getPosition().getWorld();
// No free space above
if (world.getBlockType(new Vector(x, y, z)) != 0) {
return false;
}
while (y <= world.getMaxY()) {
// Found a ceiling!
if (!BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) {
int platformY = Math.max(initialY, y - 3 - clearance);
floatAt(x, platformY + 1, z, alwaysGlass);
return true;
}
++y;
}
return false;
}
示例3: ascendLevel
import com.sk89q.worldedit.world.World; //导入方法依赖的package包/类
@Override
public boolean ascendLevel() {
final WorldVector pos = getBlockIn();
final int x = pos.getBlockX();
int y = Math.max(0, pos.getBlockY());
final int z = pos.getBlockZ();
final World world = pos.getWorld();
byte free = 0;
byte spots = 0;
while (y <= world.getMaxY() + 2) {
if (BlockType.canPassThrough(world.getBlock(new Vector(x, y, z)))) {
++free;
} else {
free = 0;
}
if (free == 2) {
++spots;
if (spots == 2) {
final Vector platform = new Vector(x, y - 2, z);
final BaseBlock block = world.getBlock(platform);
final int type = block.getId();
// Don't get put in lava!
if (type == BlockID.LAVA || type == BlockID.STATIONARY_LAVA) {
return false;
}
setPosition(platform.add(0.5, BlockType.centralTopLimit(block), 0.5));
return true;
}
}
++y;
}
return false;
}
示例4: NMSMappedFaweQueue
import com.sk89q.worldedit.world.World; //导入方法依赖的package包/类
public NMSMappedFaweQueue(World world) {
super(world);
this.maxY = world.getMaxY();
}
示例5: FastWorldEditExtent
import com.sk89q.worldedit.world.World; //导入方法依赖的package包/类
public FastWorldEditExtent(final World world, FaweQueue queue) {
super(queue);
this.queue = queue;
this.maxY = world.getMaxY();
}
示例6: getMaxY
import com.sk89q.worldedit.world.World; //导入方法依赖的package包/类
default int getMaxY() {
World weWorld = getWEWorld();
return weWorld == null ? 255 : weWorld.getMaxY();
}