Skip to content
Ben edited this page May 26, 2016 · 27 revisions

Want to hook into my plugin? Here's a basic overview on the API. Just know that the API is built for me.

####User object:

  • I use a user object to handle most things with a user, there is a Data class that actually handles the file reading/editing
  • Creating object:
    new User(playerName);
    new User(new UUID(uuid));
    new User(player);

####VoteSite object:

  • Similary, I use a votesite object to handle stuff with votesites, there is a ConfigVoteSites class that handles the file reading/editing
  • Create object:
    new VoteSite(siteName);
    plugin.getVoteSite(name);
  • BonusReward has its own class that handles bonus rewards, called BonusVoteReward

####Adding commands into /v or /av

  • With my command system, you can add your own custom commands in /vote or /adminvote, with tab complete support

  • Define what arguments to add ("player","sitename","string","number")

  • Examples (plugin is my Main plugin class, either add a CommandHandler to voteCommand or adminVoteCommand):

      plugin.voteCommand.add(new CommandHandler(new String[] { "Next",
      		"player" }, "Permission") {
      	@Override
      	public void execute(CommandSender sender, String[] args) {
                          // code to run when command is executed, if player has perms and
                          // args like number is met, plugin will check if it should be a number (if a arg is "number"), 
                          // no need to add it here
      	}
      });
    

####Examples: More to be added.

Get total votes: user.getTotalVotes();

Clone this wiki locally