Difference between revisions of "SuperStats"

From PedroJM96 Wiki EN
Jump to: navigation, search
Line 40: Line 40:
 
|  superstats.admin || To use the statsreload command
 
|  superstats.admin || To use the statsreload command
 
|}
 
|}
 +
 +
==Api==
 +
 +
<syntaxhighlight lang="Java">
 +
public class Example_Stats extends Plugin_Hook {
 +
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;
 +
}
 +
}
 +
</syntaxhighlight>

Revision as of 18:47, 10 February 2018

SuperStats is a plugin that collects data from different plugins on different servers to a database, and then is displayed in a menu on any server with a menu.

Placeholders Collected

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

SuperStats:Placeholders Collected

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

Commands

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

Api

public class Example_Stats extends Plugin_Hook {
	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;
}
}