SuperStats

From PedroJM96 Wiki EN
Jump to: navigation, search

SuperStats is an add-on that collects data from many add-ons on different servers in a database, and then it is displayed on any server with a menu, with sing or on a web page.

Placeholders Collected

What information you collect from the plugins. This add-on will collect the following placeholder.

SuperStats:Placeholders Collected


How to show the data

  • For normal data:
    • <stats_[placeholder]>
    • Example: <stats_skywarsx-wins>
  • For time data:
    • <stats_[placeholder]:timeformat>
    • Example: <stats_localstats-playtime:timeformat>
  • For data by servers:
    • <stats_[placeholder]:[servername]>
    • Example: <stats_localstats-blocksbreak:survival>

Change [placeholder] to one of the list

Installation

  • Copy the JAR file in the directory of plugins
  • Restart the server to install.
  • (Optional) Install the Web Addon ✪ SuperStats ✪ Web Addon
  • To display data on the web page
  • And enjoy the plugin!.

Tutorial

  • Install the plugin on all servers
  • Configure the servers where you want to collect data (example: SkyWars, PVP, SkyBlock)
    • Configure the stats according to the installed plugin and the data to collect (Example: in the SkyWars server I configure the stats of a SkyWars plugin)
    • To configure the stats of a plugin fence to the stats folder and edit the configuration that has the name of the plugin. Set hook to true and the identifiers to use to true. (Example: kill = true, score = true)
  • Set up on the lobby server with the same database as the other servers and have access to all placeholders of the plugins installed on another server.

Commands

Commands Permissions Info
/stats superstats.use Displays the statistics menu
/statsreload superstats.admin to reload the configuration

Permissions

Permissions Info
superstats.use To use the stats command
superstats.admin To use the statsreload command

Configuration

Api

This guide will show you how to register your own placeholders from your plugin.

Create a register class

public class Example_Stats extends StatsHook {
	public Example_Stats(JavaPlugin plugin) {
		//super(plugin,false,Name for the plugin configuration,List of data to collect)	
    	super(plugin,false,"Example_Stats",Arrays.asList("example1","example2"));	
	}
 
	@Override
	public String onStatsRequest(Player paramPlayer, String stats) {
    	if (paramPlayer == null) {
        	return null;
        }
 
	    if(stats.equals("example1")){
			return String.valueOf("Example Stats 1");	
	    }
 
	    if(stats.equals("example2")){
			return String.valueOf("Example Stats 2");
	    }
	    
	    return null;
     }

    @Override
	public String getIdentifier() {
    	// TODO Auto-generated method stub
		return "example";
	}
}

Register the class in the onEnable ()

public void onEnable(){
    //SuperStats.registerPlaceholderStats(The class that collects the data);
    SuperStats.registerPlaceholderStats(new Example_Stats(this));
 
}

The variables that register are.

  • example_example1
  • example_example2