Examples of SBlock


Examples of com.warrows.plugins.TreeSpirit.trees.components.SBlock

    newPlayersNames.remove(player.getName());
  }

  public static boolean isHeart(Block block)
  {
    return hearts.contains(new SBlock(block));
  }
View Full Code Here

Examples of com.warrows.plugins.TreeSpirit.trees.components.SBlock

    return greatTreesByPlayerName.get(playerName);
  }

  public static GreatTree getGreatTree(Block block)
  {
    return greatTreesByBlock.get(new SBlock(block));
  }
View Full Code Here

Examples of com.warrows.plugins.TreeSpirit.trees.components.SBlock

    }
    boolean destroy = TreeSpiritPlugin.getConfigInstance().getBoolean(
        "destroy-when-loose");
    for (Block b : set)
    {
      if (hearts.contains(new SBlock(b)))
      {
        if (destroy)
          b.setType(Material.AIR);
        else
          b.setType(Material.OBSIDIAN);
        hearts.remove(new SBlock(b));
      } else
      {
        if (destroy)
          tree.removeFromBody(b, 0);
        else
View Full Code Here

Examples of com.warrows.plugins.TreeSpirit.trees.components.SBlock

   * @param type
   */
  public GreatTree(Block heart, String player, byte type)
  {
    this.drops = new Stack<ItemStack>();
    this.heart = new SBlock(heart);
    this.body = new TreeBody<SBlock>();
    this.body.add(this.heart);
    this.playerName = player;
    this.type = type;
    heart.setType(Material.GLOWSTONE);
View Full Code Here

Examples of com.warrows.plugins.TreeSpirit.trees.components.SBlock

      if (player == playerConnecting)
        tree.update();
      return;
    }
    this.drops = new Stack<ItemStack>();
    this.heart = new SBlock(data[1].substring(data[1].indexOf(": ") + 2));
    this.body = new TreeBody<SBlock>();
    String bodyStr = s.substring(s.indexOf("{"), s.indexOf("}"));
    for (String sBlock : bodyStr.split(","))
    {
      SBlock sb = new SBlock(sBlock);
      body.add(sb);
      TreesData.greatTreesByBlock.put(sb, this);
    }
    this.playerName = player;
    this.type = Byte
View Full Code Here

Examples of com.warrows.plugins.TreeSpirit.trees.components.SBlock

  private boolean isInBody(Block block)
  {
    for (SBlock bodyPart : body)
    {
      if (bodyPart.equals(new SBlock(block)))
        return true;
    }
    return false;
  }
View Full Code Here

Examples of com.warrows.plugins.TreeSpirit.trees.components.SBlock

    return false;
  }

  public void addToBody(Block block)
  {
    TreesData.greatTreesByBlock.put(new SBlock(block), this);
    body.add(new SBlock(block));
  }
View Full Code Here

Examples of com.warrows.plugins.TreeSpirit.trees.components.SBlock

    body.add(new SBlock(block));
  }

  public void removeFromBody(Block block, int drop)
  {
    TreesData.greatTreesByBlock.remove(new SBlock(block));
    body.remove(new SBlock(block));
    switch (drop)
    {
      /* drop = 0 : drop normal
       * drop = 1 ; pas de drop
       * drop = 2 ; drop avec shears
View Full Code Here

Examples of com.warrows.plugins.TreeSpirit.trees.components.SBlock

  public static void checkBlock(GreatTree tree, Block origin)
  {
    for (BlockFace bf : BlockFace.values())
    {
      HashSet<SBlock> toDestroy = new HashSet<SBlock>();
      SBlock sb = new SBlock(origin.getRelative(bf));
      tree.checkBlock(sb, toDestroy);
      for (SBlock sb1 : toDestroy)
      {
        tree.removeFromBody(sb1.getBukkitBlock(), 0);
      }
View Full Code Here

Examples of com.warrows.plugins.TreeSpirit.trees.components.SBlock

  private boolean checkBlock(SBlock origin, HashSet<SBlock> tested)
  {
    for (BlockFace bf : BlockFace.values())
    {
      SBlock sb = new SBlock(origin.getBukkitBlock().getRelative(bf));
      if (!tested.contains(sb) && isInBody(sb.getBukkitBlock()))
      {
        if (heart.equals(sb))
        {
          tested.clear();
          return true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.