use of com.djrapitops.plan.extension.builder.ExtensionDataBuilder in project Plan by plan-player-analytics.
the class DataValueGatherer method updateValues.
public void updateValues(UUID playerUUID, String playerName) {
Parameters parameters = Parameters.player(serverInfo.getServerUUID(), playerUUID, playerName);
ExtensionDataBuilder dataBuilder = extension.getExtension().newExtensionDataBuilder();
addValuesToBuilder(dataBuilder, extension.getMethods().get(ExtensionMethod.ParameterType.PLAYER_STRING), parameters);
addValuesToBuilder(dataBuilder, extension.getMethods().get(ExtensionMethod.ParameterType.PLAYER_UUID), parameters);
gatherPlayer(parameters, (ExtDataBuilder) dataBuilder);
dbSystem.getDatabase().executeTransaction(new RemoveInvalidResultsTransaction(extension.getPluginName(), serverInfo.getServerUUID(), ((ExtDataBuilder) dataBuilder).getInvalidatedValues()));
}
use of com.djrapitops.plan.extension.builder.ExtensionDataBuilder in project Plan by plan-player-analytics.
the class DataValueGatherer method updateValues.
public void updateValues() {
Parameters parameters = Parameters.server(serverInfo.getServerUUID());
ExtensionDataBuilder dataBuilder = extension.getExtension().newExtensionDataBuilder();
addValuesToBuilder(dataBuilder, extension.getMethods().get(ExtensionMethod.ParameterType.SERVER_NONE), parameters);
gather(parameters, (ExtDataBuilder) dataBuilder);
}
use of com.djrapitops.plan.extension.builder.ExtensionDataBuilder in project Plan by plan-player-analytics.
the class DataValueGatherer method addDataFromAnotherBuilder.
private void addDataFromAnotherBuilder(ExtensionDataBuilder dataBuilder, Parameters parameters, ExtensionMethod provider) {
try {
ExtensionDataBuilder providedBuilder = callMethod(provider, parameters, ExtensionDataBuilder.class);
dataBuilder.addAll(providedBuilder);
} catch (DataExtensionMethodCallException methodError) {
logFailure(methodError);
} catch (Exception | NoClassDefFoundError | NoSuchFieldError | NoSuchMethodError unexpectedError) {
logFailure(unexpectedError);
}
}
Aggregations