Created
June 18, 2013 02:42
-
-
Save rmsy/5802284 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.sk89q.bukkit.util.BukkitCommandsManager; | |
import com.sk89q.bukkit.util.CommandsManagerRegistration; | |
import com.sk89q.minecraft.util.commands.CommandsManager; | |
import org.bukkit.plugin.java.JavaPlugin; | |
import org.mcstats.Metrics; | |
import javax.annotation.Nonnull; | |
import javax.annotation.Nullable; | |
import java.io.IOException; | |
import java.util.logging.Level; | |
public class ChannelsPlugin extends JavaPlugin { | |
/** | |
* The plugin's commands. | |
*/ | |
private static final Class[] COMMANDS = new Class[]{SomeCommandClass.class}; | |
/** | |
* The MCStats metrics instance. Null if creation failed. | |
*/ | |
@Nullable | |
private Metrics metrics; | |
/** | |
* The command manager. | |
*/ | |
@Nonnull | |
private CommandsManager commandsManager; | |
/** | |
* The command registration. | |
*/ | |
@Nonnull | |
private CommandsManagerRegistration commandsRegistration; | |
@Override | |
public void onDisable() { | |
} | |
@Override | |
public void onEnable() { | |
this.commandsManager = new BukkitCommandsManager(); | |
this.commandsRegistration = new CommandsManagerRegistration(this, this.commandsManager); | |
for (Class commandsClass : ChannelsPlugin.COMMANDS) { | |
this.commandsRegistration.register(commandsClass); | |
} | |
try { | |
this.metrics = new Metrics(this); | |
this.metrics.start(); | |
} catch (IOException exception) { | |
this.getLogger().log(Level.WARNING, "An unknown error occurred. Metrics were not started."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment