Skip to content

Developer API Guide

Animosity edited this page Mar 1, 2011 · 14 revisions

CraftIRC API

New in CraftIRC 2.x is an API for developers to integrate CraftIRC into their existing plugins, and create all-new CraftIRC plugins with ease.

Basic Concepts

Tags: Each server operator can configure CraftIRC to output to as many IRC servers and channels as they like. Addressing each individual channel has been abstracted into the concept of the 'Tag'. Server operators can define the tag of a server (which serves to allow messaging all channels that CraftIRC resides in, on that server), and also the Tag of a channel (which serves to target messages to that single channel). It is good practice to allow your plugin users to define which Tags (preferably channel tags) to associate with your plugin.

For example: if you are writing a chat plugin which supports multiple in-game chatrooms, you may want to add an IRC chatroom within your plugin to consolidate such conversations. Allow the server operator to designate which channel Tag/s to associate with that chatroom, so that you can route the output of that chat to appropriate Tags.

You can send a message to a Tag via CraftIRC.sendMsgToTag(String tag)

Clone this wiki locally