Package com.sk89q.worldedit.blocks

Examples of com.sk89q.worldedit.blocks.BaseBlock


    )
    @CommandPermissions("worldedit.removenear")
    @Logging(PLACEMENT)
    public void removeNear(Player player, LocalSession session, EditSession editSession, CommandContext args) throws WorldEditException {

        BaseBlock block = we.getBlock(player, args.getString(0), true);
        int size = Math.max(1, args.getInteger(1, 50));
        we.checkMaxRadius(size);

        int affected = editSession.removeNear(session.getPlacementPosition(player), block.getType(), size);
        player.print(affected + " block(s) have been removed.");
    }
View Full Code Here


            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;
                    }
View Full Code Here

                // So we've found a spot, but we have to drop the player
                // lightly and also check to see if there's something to
                // stand upon
                while (y >= 0) {
                    final Vector platform = new Vector(x, y, z);
                    final BaseBlock block = world.getBlock(platform);
                    final int type = block.getId();

                    // Don't want to end up in lava
                    if (type != BlockID.AIR && type != BlockID.LAVA && type != BlockID.STATIONARY_LAVA) {
                        // Found a block!
                        setPosition(platform.add(0.5, BlockType.centralTopLimit(block), 0.5));
View Full Code Here

    public BaseBlock getBlockInHand() throws WorldEditException {
        final int typeId = getItemInHand();
        if (!getWorld().isValidBlockType(typeId)) {
            throw new NotABlockException(typeId);
        }
        return new BaseBlock(typeId);
    }
View Full Code Here

        this.fullHeight = fullHeight;
    }

    @Override
    public void build(EditSession editSession, Vector position, Pattern pattern, double size) throws MaxChangedBlocksException {
        final BaseBlock air = new BaseBlock(BlockID.AIR, 0);
        final double startY = fullHeight ? editSession.getWorld().getMaxY() : position.getBlockY() + size;
        for (double x = position.getBlockX() + size; x > position.getBlockX() - size; --x) {
            for (double z = position.getBlockZ() + size; z > position.getBlockZ() - size; --z) {
                double y = startY;
                final List<BaseBlock> blockTypes = new ArrayList<BaseBlock>();
                for (; y > position.getBlockY() - size; --y) {
                    final Vector pt = new Vector(x, y, z);
                    final BaseBlock block = editSession.getBlock(pt);
                    if (!block.isAir()) {
                        blockTypes.add(block);
                        editSession.setBlock(pt, air);
                    }
                }
                Vector pt = new Vector(x, y, z);
View Full Code Here

    * @see com.sk89q.worldedit.LocalWorld#getBlock(com.sk89q.worldedit.Vector)
    */
   @Override
   public BaseBlock getBlock(Vector pos) {
      try {
         return new BaseBlock(getBlockType(pos), getBlockData(pos));
      } catch (Exception e) {
         return null;
      }
   }
View Full Code Here

        try {
            CuboidRegion region = new CuboidRegion(origin, origin.add(size.getX() - 1, size.getY() - 1,
                    size.getZ() - 1));
            EditSession editSession = new EditSession(new BukkitWorld(world), -1);
            editSession.enableQueue();
            editSession.setBlocks(region, new BaseBlock(0));
            editSession.flushQueue();
        } catch (MaxChangedBlocksException e) {
            // is never thrown
        }
    }
View Full Code Here

      // we can recover from this... so eat it!
      generator.reportException("[WorldEdit] Could not resave " + metaFile.getAbsolutePath(), e);
    }
   
    // grab the edge block
    BaseBlock edge = cuboid.getBlock(new Vector(0, groundLevelY, 0));
    edgeType = edge.getType();
    edgeData = edge.getData();
    edgeRise = BlackMagic.getMaterialId(generator.oreProvider.surfaceMaterial) == edgeType ? 0 : 1;
   
    // allocate the blocks
    facingCount = 1;
    if (flipableX)
View Full Code Here

TOP

Related Classes of com.sk89q.worldedit.blocks.BaseBlock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.