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


Java World.getMaxY方法代码示例

本文整理汇总了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;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:26,代码来源:PlayerWrapper.java

示例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;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:28,代码来源:PlayerWrapper.java

示例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;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:41,代码来源:AbstractPlayerActor.java

示例4: NMSMappedFaweQueue

import com.sk89q.worldedit.world.World; //导入方法依赖的package包/类
public NMSMappedFaweQueue(World world) {
    super(world);
    this.maxY = world.getMaxY();
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:5,代码来源:NMSMappedFaweQueue.java

示例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();
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:6,代码来源:FastWorldEditExtent.java

示例6: getMaxY

import com.sk89q.worldedit.world.World; //导入方法依赖的package包/类
default int getMaxY() {
    World weWorld = getWEWorld();
    return weWorld == null ? 255 : weWorld.getMaxY();
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:5,代码来源:FaweQueue.java


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