API

API

API Info

The API can be used for developers to make plugins to go along with UserReputation, for example, a plugin that does something with the requirement of "X" reputation.

Download?

The API is incorporated in the UserReputation.jar you would download if you were putting it on your Bukkit server.
Be sure to add UserReputation.jar as an external jar (resource).

Example Code

package com.itslightness.RepAPIDemo;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import com.itslightness.UserReputation.API;

public class RepAPIDemo extends JavaPlugin {
	
	public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
		if(cmd.getName().equalsIgnoreCase("repamt")){
			if (sender instanceof Player) {
				Player player = (Player)sender;
				int userRep = API.getReputation(player.getName());
				player.sendMessage("You have " + userRep + " reputation");
			}
			return true;
		}
		return false;
	}
}

Comments

Posts Quoted:
Reply
Clear All Quotes