Fix Java 8 API compatibility

This commit is contained in:
games647 committed 2022-07-22 18:46:46 +02:00
1 parent c090278f82
commit 8df5b11276
5 files changed
+21 -7

No files matched your search

@@ -25,6 +25,7 @@
*/
package com.github.games647.fastlogin.bukkit;
import java.util.Collections;
import java.util.List;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
@@ -49,7 +50,7 @@ public class PremiumPlaceholder extends PlaceholderExpansion {
@Override
public @NotNull List<String> getPlaceholders() {
return List.of(PLACEHOLDER_VARIABLE);
return Collections.singletonList(PLACEHOLDER_VARIABLE);
}
@Override
@@ -81,7 +81,7 @@ public abstract class ToggleCommand implements CommandExecutor {
plugin.getBungeeManager().sendPluginMessage((PluginMessageRecipient) invoker, message);
} else {
Optional<? extends Player> optPlayer = Bukkit.getServer().getOnlinePlayers().stream().findFirst();
if (optPlayer.isEmpty()) {
if (!optPlayer.isPresent()) {
plugin.getLog().info("No player online to send a plugin message to the proxy");
return;
}