mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-14 12:11:23 +01:00
Extract method call booleans from PluginInfo
This commit is contained in:
parent
f73cef8587
commit
91bb5bf31b
@ -114,6 +114,10 @@ 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,10 +29,29 @@ 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