Package org.bukkit.material

Examples of org.bukkit.material.Tree


                Misc.dropItems(blockState.getLocation(), block.getDrops());
            }
            else {
                //TODO Remove this workaround when casting to Tree works again
                if (blockState.getData() instanceof Tree) {
                    Tree tree = (Tree) blockState.getData();
                    tree.setDirection(BlockFace.UP);
                }

                switch (material) {
                    case LOG:
                    case LOG_2:
View Full Code Here


    public boolean canBreakBlock(Player player, ItemInfo originalBlock, Block toBreak) {

        if((originalBlock.getType() == Material.LOG || originalBlock.getType() == Material.LOG_2) && (toBreak.getType() == Material.LEAVES || toBreak.getType() == Material.LEAVES_2) && breakLeaves) {
            MaterialData nw = toBreak.getState().getData();
            Tree old = new Tree(originalBlock.getMaterialData().getItemType(), (byte) originalBlock.getData());
            if(!(nw instanceof Tree) || !(old instanceof Tree)) return false;
            if(enforceDataValues && ((Tree) nw).getSpecies() != old.getSpecies()) return false;
        } else {
            if(toBreak.getType() != originalBlock.getType()) return false;
            if(enforceDataValues && toBreak.getData() != originalBlock.getData()) return false;
        }
View Full Code Here

    data.setInverted(inverted);
    setBlocks(x1, x2, y1, y2, z1, z2, Material.WOOD_STEP, data);
  }
 
  public final void setLog(int x, int y, int z, Material material, TreeSpecies species, BlockFace facing) {
    Tree data = new Tree(species, facing);
    setBlock(x, y, z, material, data);
  }
View Full Code Here

    Tree data = new Tree(species, facing);
    setBlock(x, y, z, material, data);
  }
 
  public final void setLogs(int x, int y1, int y2, int z, Material material, TreeSpecies species, BlockFace facing) {
    Tree data = new Tree(species, facing);
    setBlocks(x, x + 1, y1, y2, z, z + 1, material, data);
  }
View Full Code Here

    Tree data = new Tree(species, facing);
    setBlocks(x, x + 1, y1, y2, z, z + 1, material, data);
  }
 
  public final void setLogs(int x1, int x2, int y1, int y2, int z1, int z2, Material material, TreeSpecies species, BlockFace facing) {
    Tree data = new Tree(species, facing);
    setBlocks(x1, x2, y1, y2, z1, z2, material, data);
  }
View Full Code Here

      BlackMagic.setBlock(chunk, x, y, z, Material.DOUBLE_PLANT, 5);
      BlackMagic.setBlock(chunk, x, y + 1, z, Material.DOUBLE_PLANT, 8);
      break;
    case EMERALD_GREEN:
      chunk.setBlockIfNot(x, y - 1, z, Material.GRASS, Material.DIRT, Material.SOIL);
      chunk.setBlock(x, y, z, Material.LOG, new Tree(TreeSpecies.JUNGLE));
//      chunk.setBlocks(x, y + 1, y + odds.getRandomInt(2, 4), z, Material.LEAVES, new Leaves()); //TODO: Jungle + NoDecay
      BlackMagic.setBlocks(chunk, x, y + 1, y + odds.getRandomInt(2, 4), z, Material.LEAVES, 3 + 4); //TODO: Jungle + NoDecay
      break;
    case OAK_SAPLING:
      chunk.setBlockIfNot(x, y - 1, z, Material.GRASS, Material.DIRT);
      chunk.setBlock(x, y, z, Material.SAPLING, new Tree(TreeSpecies.GENERIC)); //TODO: Bukkit type mismatch/missing
      break;
    case BIRCH_SAPLING:
      chunk.setBlockIfNot(x, y - 1, z, Material.GRASS, Material.DIRT);
      chunk.setBlock(x, y, z, Material.SAPLING, new Tree(TreeSpecies.BIRCH));
      break;
    case PINE_SAPLING:
      chunk.setBlockIfNot(x, y - 1, z, Material.GRASS, Material.DIRT);
      chunk.setBlock(x, y, z, Material.SAPLING, new Tree(TreeSpecies.REDWOOD)); //TODO: Bukkit type mismatch/missing
      break;
    case JUNGLE_SAPLING:
      chunk.setBlockIfNot(x, y - 1, z, Material.GRASS, Material.DIRT);
      chunk.setBlock(x, y, z, Material.SAPLING, new Tree(TreeSpecies.JUNGLE));
      break;
    case ACACIA_SAPLING:
      chunk.setBlockIfNot(x, y - 1, z, Material.GRASS, Material.DIRT);
      chunk.setBlock(x, y, z, Material.SAPLING, new Tree(TreeSpecies.ACACIA));
      break;
     
    case MINI_OAK_TRUNK:
      generator.treeProvider.generateMiniTrunk(generator, chunk, x, y, z, TreeType.TREE);
      break;
View Full Code Here

          DyeColor color = parseEnum(DyeColor.class, text, null);
          if (color == null)
            return def;
          wdat.setColor(color);
        } else if (dat instanceof Tree) {
          Tree tdat = (Tree) dat;
          TreeSpecies species = parseTreeSpecies(text, null);
          if (species == null)
            return def;
          tdat.setSpecies(species);
        } else if (dat instanceof Leaves) {
          Leaves tdat = (Leaves) dat;
          TreeSpecies species = parseTreeSpecies(text, null);
          if (species == null)
            return def;
          tdat.setSpecies(species);
        } else if (dat instanceof LongGrass) {
          LongGrass ldat = (LongGrass) dat;
          GrassSpecies species = parseEnum(GrassSpecies.class, text, null);
          if (species == null)
            return def;
View Full Code Here

TOP

Related Classes of org.bukkit.material.Tree

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.