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


Java BlockID.BEDROCK属性代码示例

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


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

示例1: actPrimary

@Override
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
    World world = (World) clicked.getExtent();
    final int blockType = world.getBlockType(clicked.toVector());
    if (blockType == BlockID.BEDROCK
            && !player.canDestroyBedrock()) {
        return true;
    }

    EditSession editSession = session.createEditSession(player);
    editSession.getSurvivalExtent().setToolUse(config.superPickaxeDrop);

    try {
        if (editSession.setBlock(clicked.getBlockX(), clicked.getBlockY(), clicked.getBlockZ(), EditSession.nullBlock)) {
            world.playEffect(clicked.toVector(), 2001, blockType);
        }
    } finally {
        editSession.flushQueue();
        session.remember(editSession);
    }

    return true;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:23,代码来源:SinglePickaxe.java

示例2: actPrimary

@Override
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) {
    World world = (World) clicked.getExtent();

    int initialType = world.getBlockType(clicked.toVector());

    if (initialType == BlockID.AIR) {
        return true;
    }

    if (initialType == BlockID.BEDROCK && !player.canDestroyBedrock()) {
        return true;
    }

    EditSession editSession = session.createEditSession(player);

    try {
        recurse(server, editSession, world, clicked.toVector().toBlockVector(),
                clicked.toVector(), range, initialType, new HashSet<BlockVector>());
    } catch (WorldEditException e) {
        throw new RuntimeException(e);
    }
    editSession.flushQueue();
    session.remember(editSession);
    return true;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:26,代码来源:FloodFillTool.java

示例3: actPrimary

@Override
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
    World world = (World) clicked.getExtent();
    final Vector pos = clicked.toVector();

    EditSession editSession = session.createEditSession(player);

    BaseBlock block = editSession.getBlock(pos);
    int initialType = block.getType();

    if (initialType == BlockID.AIR || (initialType == BlockID.BEDROCK && !player.canDestroyBedrock())) {
        editSession.flushQueue();
        return true;
    }

    editSession.getSurvivalExtent().setToolUse(config.superPickaxeManyDrop);

    final int radius = (int) range;
    final BlockReplace replace = new BlockReplace(editSession, (editSession.nullBlock));
    editSession.setMask((Mask) null);
    RecursiveVisitor visitor = new RecursiveVisitor(new IdMask(editSession), replace, radius, editSession);
    visitor.visit(pos);
    Operations.completeBlindly(visitor);

    editSession.flushQueue();
    session.remember(editSession);

    return true;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:29,代码来源:RecursivePickaxe.java

示例4: actPrimary

@Override
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
    int ox = clicked.getBlockX();
    int oy = clicked.getBlockY();
    int oz = clicked.getBlockZ();
    int initialType = ((World) clicked.getExtent()).getBlockType(clicked.toVector());

    if (initialType == 0) {
        return true;
    }

    if (initialType == BlockID.BEDROCK && !player.canDestroyBedrock()) {
        return true;
    }

    EditSession editSession = session.createEditSession(player);
    editSession.getSurvivalExtent().setToolUse(config.superPickaxeManyDrop);

    for (int x = ox - range; x <= ox + range; ++x) {
        for (int y = oy - range; y <= oy + range; ++y) {
            for (int z = oz - range; z <= oz + range; ++z) {
                if (editSession.getLazyBlock(x, y, z).getId() != initialType) {
                    continue;
                }
                editSession.setBlock(x, y, z, air);
            }
        }
    }
    editSession.flushQueue();
    session.remember(editSession);

    return true;
}
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:33,代码来源:AreaPickaxe.java


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