Package com.ensifera.animosity.craftirc.example

Source Code of com.ensifera.animosity.craftirc.example.CraftIRCPluginExampleListener

/**
*
*/
package com.ensifera.animosity.craftirc.example;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

import com.ensifera.animosity.craftirc.CraftIRC;
import com.ensifera.animosity.craftirc.IRCEvent;

/**
* @author Animosity
*
*/
public class CraftIRCPluginExampleListener implements Listener {
    private CraftIRC plugin = null;

    public CraftIRCPluginExampleListener(CraftIRC plugin) {
        this.plugin = (CraftIRC) plugin;
    }

    @EventHandler
    public void onCustomEvent(IRCEvent event) {
        IRCEvent ircEvent = (IRCEvent) event;
        if (!ircEvent.isHandled()) {
            switch (ircEvent.eventMode) {
            case COMMAND:
                if (ircEvent.msgData.message.startsWith("example")) {
                    this.plugin.sendMessageToTag("This is an example custom CraftIRC command. The pen is %red%rrrrrrr%blue%oyal blue!",
                            ircEvent.msgData.srcChannelTag);
                    ircEvent.setHandled(true);
                }
            case AUTHED_COMMAND:
                if (ircEvent.msgData.message.startsWith("authexample")) {
                    this.plugin.sendMessageToTag("This is an example custom %u%authenticated%u% CraftIRC command.",
                            ircEvent.msgData.srcChannelTag);
                    ircEvent.setHandled(true);
                }
            }
        }
    }

}
TOP

Related Classes of com.ensifera.animosity.craftirc.example.CraftIRCPluginExampleListener

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.