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


Java BlockFace.UP属性代码示例

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


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

示例1: notchToBlockFace

/**
 * Notch uses a 0-5 to mean DOWN, UP, NORTH, SOUTH, WEST, EAST
 * in that order all over. This method is convenience to convert for us.
 *
 * @return BlockFace the BlockFace represented by this number
 */
public static BlockFace notchToBlockFace(int notch) {
    switch (notch) {
    case 0:
        return BlockFace.DOWN;
    case 1:
        return BlockFace.UP;
    case 2:
        return BlockFace.NORTH;
    case 3:
        return BlockFace.SOUTH;
    case 4:
        return BlockFace.WEST;
    case 5:
        return BlockFace.EAST;
    default:
        return BlockFace.SELF;
    }
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:24,代码来源:CraftBlock.java

示例2: send

@Override
public void send(Player p) {
    if (direction == BlockFace.UP || direction == BlockFace.DOWN) {
        new CircleForm(getLocation(), "y", getDense(), getRadius(), getAction()).send(p);
        new CircleForm(getLocation().clone().add(0, getDepth(), 0), "y", getDense(), getRadius(), getAction()).send(p);

        for (double d = getDense(); d < getDepth() - getDense(); d += getDense())
            new CircleForm(getLocation().clone().add(0, d, 0), "y", getDense(), getRadius(), getAction()).send(p);
    } else if (direction == BlockFace.EAST || direction == BlockFace.WEST) {
        new CircleForm(getLocation(), "z", getDense(), getRadius(), getAction()).send(p);
        new CircleForm(getLocation().clone().add(getDepth(), 0, 0), "z", getDense(), getRadius(), getAction()).send(p);

        for (double d = getDense(); d < getDepth() - getDense(); d += getDense())
            new CircleForm(getLocation().clone().add(d, 0, 0), "z", getDense(), getRadius(), getAction()).send(p);
    } else {
        new CircleForm(getLocation(), "x", getDense(), getRadius(), getAction()).send(p);
        new CircleForm(getLocation().clone().add(0, 0, getDepth()), "x", getDense(), getRadius(), getAction()).send(p);

        for (double d = getDense(); d < getDepth() - getDense(); d += getDense())
            new CircleForm(getLocation().clone().add(0, 0, d), "x", getDense(), getRadius(), getAction()).send(p);
    }
}
 
开发者ID:AlphaHelixDev,项目名称:AlphaLibary,代码行数:22,代码来源:BarrelForm.java

示例3: send

@Override
public void send(Player p) {
    if (direction == BlockFace.UP) {
        for (double r = basis; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new RectangleForm(getLocation().clone().subtract(0, r, 0), "y", getDense(), r, r, isFilled(), getAction()).send(p);
    } else if (direction == BlockFace.EAST) {
        for (double r = basis; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new RectangleForm(getLocation().clone().subtract(r, 0, 0), "z", getDense(), r, r, isFilled(), getAction()).send(p);
    } else if (direction == BlockFace.WEST) {
        for (double r = basis; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new RectangleForm(getLocation().clone().add(r, 0, 0), "z", getDense(), r, r, isFilled(), getAction()).send(p);
    } else if (direction == BlockFace.SOUTH) {
        for (double r = basis; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new RectangleForm(getLocation().clone().subtract(0, 0, r), "x", getDense(), r, r, isFilled(), getAction()).send(p);
    } else if (direction == BlockFace.NORTH) {
        for (double r = basis; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new RectangleForm(getLocation().clone().add(0, 0, r), "x", getDense(), r, r, isFilled(), getAction()).send(p);
    } else {
        for (double r = basis; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new RectangleForm(getLocation().clone().add(0, r, 0), "y", getDense(), r, r, isFilled(), getAction()).send(p);
    }
}
 
开发者ID:AlphaHelixDev,项目名称:AlphaLibary,代码行数:22,代码来源:PyramidForm.java

示例4: send

@Override
public void send(Player p) {
    if (direction == BlockFace.UP) {
        for (double r = baseRadius; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new CircleForm(getLocation().clone().subtract(0, r, 0), "y", getDense(), r, getAction()).send(p);
    } else if (direction == BlockFace.EAST) {
        for (double r = baseRadius; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new CircleForm(getLocation().clone().subtract(r, 0, 0), "z", getDense(), r, getAction()).send(p);
    } else if (direction == BlockFace.WEST) {
        for (double r = baseRadius; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new CircleForm(getLocation().clone().add(r, 0, 0), "z", getDense(), r, getAction()).send(p);
    } else if (direction == BlockFace.SOUTH) {
        for (double r = baseRadius; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new CircleForm(getLocation().clone().subtract(0, 0, r), "x", getDense(), r, getAction()).send(p);
    } else if (direction == BlockFace.NORTH) {
        for (double r = baseRadius; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new CircleForm(getLocation().clone().add(0, 0, r), "x", getDense(), r, getAction()).send(p);
    } else {
        for (double r = baseRadius; r > 0 && size != 0; r -= getDense(), size -= getDense())
            new CircleForm(getLocation().clone().add(0, r, 0), "y", getDense(), r, getAction()).send(p);
    }
}
 
开发者ID:AlphaHelixDev,项目名称:AlphaLibary,代码行数:22,代码来源:ConeForm.java

示例5: getBlockPower

public int getBlockPower(BlockFace face) {
    int power = 0;
    BlockRedstoneWire wire = Blocks.redstone_wire;
    net.minecraft.world.World world = chunk.getHandle().worldObj;
    if ((face == BlockFace.DOWN || face == BlockFace.SELF) && world.getIndirectPowerOutput(x, y - 1, z, 0)) power = wire.func_150178_a(world, x, y - 1, z, power);
    if ((face == BlockFace.UP || face == BlockFace.SELF) && world.getIndirectPowerOutput(x, y + 1, z, 1)) power = wire.func_150178_a(world, x, y + 1, z, power);
    if ((face == BlockFace.EAST || face == BlockFace.SELF) && world.getIndirectPowerOutput(x + 1, y, z, 2)) power = wire.func_150178_a(world, x + 1, y, z, power);
    if ((face == BlockFace.WEST || face == BlockFace.SELF) && world.getIndirectPowerOutput(x - 1, y, z, 3)) power = wire.func_150178_a(world, x - 1, y, z, power);
    if ((face == BlockFace.NORTH || face == BlockFace.SELF) && world.getIndirectPowerOutput(x, y, z - 1, 4)) power = wire.func_150178_a(world, x, y, z - 1, power);
    if ((face == BlockFace.SOUTH || face == BlockFace.SELF) && world.getIndirectPowerOutput(x, y, z + 1, 5)) power = wire.func_150178_a(world, x, y, z - 1, power);
    return power > 0 ? power : (face == BlockFace.SELF ? isBlockIndirectlyPowered() : isBlockFaceIndirectlyPowered(face)) ? 15 : 0;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:12,代码来源:CraftBlock.java

示例6: checkChunk

private void checkChunk(ChunkPosition pos, @Nullable Chunk chunk) {
    if(repairedChunks.add(pos)) {
        if(chunk == null) {
            chunk = pos.getChunk(match.getWorld());
        }

        for(BlockState state : chunk.getTileEntities()) {
            if(state instanceof Skull) {
                if(!NMSHacks.isSkullCached((Skull) state)) {
                    Location loc = state.getLocation();
                    broadcastDeveloperWarning("Uncached skull \"" + ((Skull) state).getOwner() + "\" at " + loc.getBlockX() + ", " + loc.getBlockY() + ", " + loc.getBlockZ());
                }
            }
        }

        // Replace formerly invisible half-iron-door blocks with barriers
        for(Block ironDoor : chunk.getBlocks(Material.IRON_DOOR_BLOCK)) {
            BlockFace half = (ironDoor.getData() & 8) == 0 ? BlockFace.DOWN : BlockFace.UP;
            if(ironDoor.getRelative(half.getOppositeFace()).getType() != Material.IRON_DOOR_BLOCK) {
                ironDoor.setType(Material.BARRIER, false);
            }
        }

        // Remove all block 36 and remember the ones at y=0 so VoidFilter can check them
        for(Block block36 : chunk.getBlocks(Material.PISTON_MOVING_PIECE)) {
            if(block36.getY() == 0) {
                block36Locations.add(block36.getX(), block36.getY(), block36.getZ());
            }
            block36.setType(Material.AIR, false);
        }
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:32,代码来源:WorldProblemMatchModule.java


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