mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 03:27:37 +01:00
Removed update booleans from PluginInfo
This commit is contained in:
parent
5928912a54
commit
ffce4c9e32
@ -67,22 +67,4 @@ public @interface PluginInfo {
|
||||
* @return Preferred color. If none are specified defaults are used.
|
||||
*/
|
||||
Color color() default Color.NONE;
|
||||
|
||||
/**
|
||||
* Should Plan call the player data provider methods when the player leaves.
|
||||
* <p>
|
||||
* By default Plan calls the player methods only short time after joining.
|
||||
*
|
||||
* @return {@code false} by default.
|
||||
*/
|
||||
boolean updatePlayerDataOnLeave() default false;
|
||||
|
||||
/**
|
||||
* Should Plan call the server data provider methods periodically.
|
||||
* <p>
|
||||
* By default Plan calls the server methods only short time after the extension is registered.
|
||||
*
|
||||
* @return {@code false} by default.
|
||||
*/
|
||||
boolean updateServerDataPeriodically() default false;
|
||||
}
|
||||
|
@ -115,9 +115,6 @@ public class DataProviderExtractor {
|
||||
private void extractAllDataProviders() {
|
||||
PluginInfo pluginInfo = extensionExtractor.getPluginInfo();
|
||||
|
||||
dataProviders.setCallPlayerMethodsOnPlayerLeave(pluginInfo.updatePlayerDataOnLeave());
|
||||
dataProviders.setCallServerMethodsPeriodically(pluginInfo.updateServerDataPeriodically());
|
||||
|
||||
MethodAnnotations methodAnnotations = extensionExtractor.getMethodAnnotations();
|
||||
Map<Method, Tab> tabs = methodAnnotations.getMethodAnnotations(Tab.class);
|
||||
Map<Method, Conditional> conditions = methodAnnotations.getMethodAnnotations(Conditional.class);
|
||||
|
@ -29,29 +29,10 @@ public class DataProviders {
|
||||
|
||||
private Map<MethodType, Map<Class, List<DataProvider>>> byMethodType;
|
||||
|
||||
private boolean callPlayerMethodsOnPlayerLeave;
|
||||
private boolean callServerMethodsPeriodically;
|
||||
|
||||
public DataProviders() {
|
||||
byMethodType = new EnumMap<>(MethodType.class);
|
||||
}
|
||||
|
||||
public void setCallPlayerMethodsOnPlayerLeave(boolean callPlayerMethodsOnPlayerLeave) {
|
||||
this.callPlayerMethodsOnPlayerLeave = callPlayerMethodsOnPlayerLeave;
|
||||
}
|
||||
|
||||
public void setCallServerMethodsPeriodically(boolean callServerMethodsPeriodically) {
|
||||
this.callServerMethodsPeriodically = callServerMethodsPeriodically;
|
||||
}
|
||||
|
||||
public boolean shouldCallPlayerMethodsOnPlayerLeave() {
|
||||
return callPlayerMethodsOnPlayerLeave;
|
||||
}
|
||||
|
||||
public boolean shouldCallServerMethodsPeriodically() {
|
||||
return callServerMethodsPeriodically;
|
||||
}
|
||||
|
||||
public <T> void put(DataProvider<T> provider) {
|
||||
MethodWrapper<T> method = provider.getMethod();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user