If results aren't successful, only print the error

This commit is contained in:
Frank van der Heijden 2021-08-04 15:55:04 +02:00
parent ae6f361ac1
commit a84189e290
No known key found for this signature in database
GPG key ID: B808721C2DD5B5B8

View file

@ -69,6 +69,11 @@ public class PluginResults<T> implements Iterable<PluginResult<T>> {
* Sends the result(s) to the given sender.
*/
public void sendTo(ServerUtilsAudience<?> sender, ConfigKey successKey) {
if (!isSuccess()) {
last().sendTo(sender, successKey);
return;
}
for (PluginResult<T> result : results) {
result.sendTo(sender, successKey);
}