Removed update booleans from PluginInfo

This commit is contained in:
Rsl1122 2019-03-31 11:42:27 +03:00
parent 5928912a54
commit ffce4c9e32
3 changed files with 0 additions and 40 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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();