Ejemplo n.º 1
0
  /**
   * Prints a chip block info. When block points to a chip pin, the player receives an /rcpin
   * message of this pin. When block points to an activation block, debug mode is toggled for this
   * player. When block points to any other structure block the chip info is sent.
   *
   * @param player The player to send the info message to.
   * @param block Queried block.
   */
  public void probeChipBlock(Player player, Block block) {
    try {
      RCpin.printPinInfo(block, player, this);
    } catch (IllegalArgumentException ie) {
      // not probing a pin
      Circuit c = circuitManager.getCircuitByStructureBlock(block.getLocation());

      if (c != null) {
        if (c.activationBlock.equals(block.getLocation())) player.performCommand("rcdebug");
        else RCinfo.printCircuitInfo(player, c, this);
      }
    }
  }