Skip to content
This repository was archived by the owner on May 27, 2020. It is now read-only.

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ScoreLib

ScoreLib is a solution for violation calculation-like
Lite and Simple to use

Permissions

scorelib.CategoryName.bypass Bypass the Analyzer from the Category

Import

Maven:

 <repositories>
<repository>
<id>scorelib</id>
<url>https://raw.githubusercontent.com/Server-CT/ScoreLib/master/repo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.serverct</groupId>
<artifactId>ScoreLib</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>

Usage

packageorg.serverct.vl;
importorg.bukkit.event.EventHandler;
importorg.serverct.vl.analyzer.Executor;
importorg.serverct.vl.analyzer.Stat;
importorg.serverct.vl.bean.Mode;
importorg.serverct.vl.events.ConditionsMetEvent;
importorg.serverct.vl.util.Category;
importjava.util.UUID;
publicclassExample {
CategoryFishing=newCategory("Fishing");
publicExample(){
Executora =Fishing.addExecutor("XD");
/* Action: when something reach X,Executor call the events.(ConditionMetEvent) */a.putAction(6,true);// Executor will call event when something reach 6a.putAction(5,true);// Executor will call event when something reach 5/* Executor modes: TRIG: call events when score update (default) CHECKER: call events when ScoreUpdater check stats MIX: for all. */a.setMode(Mode.CHECKER);
/* Executor has some functions for automatic: ScoreTrigger and ScoreUpdater. ScoreTrigger call event when something reach the score you set. ScoreUpdater check every stats' last modified time and lower increase timeout stat' score. Set AliveTime to -1 for disabled Updater. */a.start(20,1);//20 ticks for updater cycle,1 score for lower increase amount// Just Stat.Statb=Fishing.addStat("CounterOfFishes");
b.addScore(UUID.randomUUID(),1);
b.fromScore(1);//return ids which score is 1
}
@EventHandlerpublicvoidonScore(ConditionsMetEvente){
getLogger().info(e.getTaskID()+" : Object: "+e.getUUID().toString()+" Reached "+e.getScore());
//6 or 5
}
}

About

ScoreLib is a solution for violation calculation-like but simply.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages