diff --git a/src/main/java/de/hdg/keklist/KeklistMetrics.java b/src/main/java/de/hdg/keklist/KeklistMetrics.java index 10f2c96..ac2ed4c 100644 --- a/src/main/java/de/hdg/keklist/KeklistMetrics.java +++ b/src/main/java/de/hdg/keklist/KeklistMetrics.java @@ -23,17 +23,11 @@ public void shutdown() { } private void initChars() { - metrics.addCustomChart(new SimplePie("keklist_language", () -> { - return Keklist.getTranslations().getLanguageCode(); - })); + metrics.addCustomChart(new SimplePie("keklist_language", () -> Keklist.getTranslations().getLanguageCode())); - metrics.addCustomChart(new SimplePie("keklist_whitelist", () -> { - return plugin.getConfig().getBoolean("whitelist.enabled") ? "enabled" : "disabled"; - })); + metrics.addCustomChart(new SimplePie("keklist_whitelist", () -> plugin.getConfig().getBoolean("whitelist.enabled") ? "enabled" : "disabled")); - metrics.addCustomChart(new SimplePie("keklist_blacklist", () -> { - return plugin.getConfig().getBoolean("blacklist.enabled") ? "enabled" : "disabled"; - })); + metrics.addCustomChart(new SimplePie("keklist_blacklist", () -> plugin.getConfig().getBoolean("blacklist.enabled") ? "enabled" : "disabled")); metrics.addCustomChart(new SingleLineChart("keklist_whitelisted", () -> { ResultSet rsPlayers = Keklist.getDatabase().onQuery("SELECT COUNT(*) FROM whitelist"); diff --git a/src/main/java/de/hdg/keklist/api/events/whitelist/PlayerRemovedFromWhitelistEvent.java b/src/main/java/de/hdg/keklist/api/events/whitelist/PlayerRemovedFromWhitelistEvent.java index bbfe3ef..0190b31 100644 --- a/src/main/java/de/hdg/keklist/api/events/whitelist/PlayerRemovedFromWhitelistEvent.java +++ b/src/main/java/de/hdg/keklist/api/events/whitelist/PlayerRemovedFromWhitelistEvent.java @@ -1,7 +1,6 @@ package de.hdg.keklist.api.events.whitelist; import de.hdg.keklist.api.KeklistAPI; -import org.bukkit.Bukkit; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/de/hdg/keklist/api/events/whitelist/UUIDAddToWhitelistEvent.java b/src/main/java/de/hdg/keklist/api/events/whitelist/UUIDAddToWhitelistEvent.java index 419a018..7885449 100644 --- a/src/main/java/de/hdg/keklist/api/events/whitelist/UUIDAddToWhitelistEvent.java +++ b/src/main/java/de/hdg/keklist/api/events/whitelist/UUIDAddToWhitelistEvent.java @@ -1,7 +1,6 @@ package de.hdg.keklist.api.events.whitelist; import de.hdg.keklist.Keklist; -import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; diff --git a/src/main/java/de/hdg/keklist/commands/BlacklistCommand.java b/src/main/java/de/hdg/keklist/commands/BlacklistCommand.java index e2f45c5..ae3d549 100644 --- a/src/main/java/de/hdg/keklist/commands/BlacklistCommand.java +++ b/src/main/java/de/hdg/keklist/commands/BlacklistCommand.java @@ -89,7 +89,7 @@ public boolean execute(@NotNull CommandSender sender, @NotNull String commandLab if (type.equals(BlacklistType.JAVA)) { Request request = new Request.Builder().url("https://api.mojang.com/users/profiles/minecraft/" + args[1]).build(); - client.newCall(request).enqueue(new UserBlacklistAddCallback((sender instanceof Player) ? (Player) sender : null, reason)); + client.newCall(request).enqueue(new UserBlacklistAddCallback((sender instanceof Player) ? sender : null, reason)); } else if (type.equals(BlacklistType.IPv4) || type.equals(BlacklistType.IPv6)) { ResultSet rs = Keklist.getDatabase().onQuery("SELECT * FROM blacklistIp WHERE ip = ?", args[1]); diff --git a/src/main/java/de/hdg/keklist/extentions/PlanHook.java b/src/main/java/de/hdg/keklist/extentions/PlanHook.java index 68b643c..5b0245b 100644 --- a/src/main/java/de/hdg/keklist/extentions/PlanHook.java +++ b/src/main/java/de/hdg/keklist/extentions/PlanHook.java @@ -9,9 +9,10 @@ import java.util.Optional; +@Getter public class PlanHook { - private @Getter Optional caller; + private Optional caller; public PlanHook() { diff --git a/src/main/java/de/hdg/keklist/gui/events/blacklist/BlacklistEntryEvent.java b/src/main/java/de/hdg/keklist/gui/events/blacklist/BlacklistEntryEvent.java index 2ec7d22..de186e8 100644 --- a/src/main/java/de/hdg/keklist/gui/events/blacklist/BlacklistEntryEvent.java +++ b/src/main/java/de/hdg/keklist/gui/events/blacklist/BlacklistEntryEvent.java @@ -71,7 +71,7 @@ public void onEntryClick(InventoryClickEvent event) { meta.lore(List.of( Keklist.getInstance().getMiniMessage().deserialize(translations.get("gui.blacklist.entry.player.name", username)), Keklist.getInstance().getMiniMessage().deserialize(translations.get("gui.blacklist.entry.player.uuid")), - Keklist.getInstance().getMiniMessage().deserialize("" + uuid.toString()), + Keklist.getInstance().getMiniMessage().deserialize("" + uuid), Keklist.getInstance().getMiniMessage().deserialize(translations.get("gui.blacklist.entry.player.by", byPlayer)), Keklist.getInstance().getMiniMessage().deserialize(translations.get("gui.blacklist.entry.player.date", sdf.format(new Date(unix)))), Keklist.getInstance().getMiniMessage().deserialize(translations.get("gui.blacklist.entry.reason", reason)) diff --git a/src/main/java/de/hdg/keklist/gui/events/whitelist/WhitelistEntryEvent.java b/src/main/java/de/hdg/keklist/gui/events/whitelist/WhitelistEntryEvent.java index f601285..ed96fc3 100644 --- a/src/main/java/de/hdg/keklist/gui/events/whitelist/WhitelistEntryEvent.java +++ b/src/main/java/de/hdg/keklist/gui/events/whitelist/WhitelistEntryEvent.java @@ -72,7 +72,7 @@ public void onEntryClick(InventoryClickEvent event) { meta.lore(List.of( Keklist.getInstance().getMiniMessage().deserialize(translations.get("gui.whitelist.entry.player.name", username)), Keklist.getInstance().getMiniMessage().deserialize(translations.get("gui.whitelist.entry.player.uuid")), - Keklist.getInstance().getMiniMessage().deserialize("" + uuid.toString()), + Keklist.getInstance().getMiniMessage().deserialize("" + uuid), Keklist.getInstance().getMiniMessage().deserialize(translations.get("gui.whitelist.entry.player.by", byPlayer)), Keklist.getInstance().getMiniMessage().deserialize(translations.get("gui.whitelist.entry.player.date", sdf.format(new Date(unix)))) )); @@ -87,7 +87,7 @@ public void onEntryClick(InventoryClickEvent event) { }); overview.setItem(15, removeItem); - overview.setItem(18, getBackArrow(event.getClickedInventory())); + overview.setItem(18, getBackArrow()); player.openInventory(overview); } else { @@ -141,7 +141,7 @@ public void onEntryClick(InventoryClickEvent event) { }); overview.setItem(15, removeItem); - overview.setItem(18, getBackArrow(event.getClickedInventory())); + overview.setItem(18, getBackArrow()); player.openInventory(overview); } else { @@ -210,7 +210,7 @@ public void onRemoveClick(InventoryClickEvent event) throws SQLException { if (event.getCurrentItem().getType() == Material.BARRIER) { ItemStack item = event.getClickedInventory().getItem(4); - String username = PlainTextComponentSerializer.plainText().serialize(item.getItemMeta().displayName());; + String username = PlainTextComponentSerializer.plainText().serialize(item.getItemMeta().displayName()); Keklist.getDatabase().onUpdate("DELETE FROM whitelist WHERE name = ?", username); player.sendMessage( @@ -239,7 +239,7 @@ public void onRemoveClick(InventoryClickEvent event) throws SQLException { } } - private ItemStack getBackArrow(Inventory inventory) { + private ItemStack getBackArrow() { int pageIndex = 0; int skipIndex = 0; boolean onlyPlayer = false; diff --git a/src/main/java/de/hdg/keklist/util/KeklistConfigUtil.java b/src/main/java/de/hdg/keklist/util/KeklistConfigUtil.java index 2aa9beb..98bca9a 100644 --- a/src/main/java/de/hdg/keklist/util/KeklistConfigUtil.java +++ b/src/main/java/de/hdg/keklist/util/KeklistConfigUtil.java @@ -16,7 +16,7 @@ public class KeklistConfigUtil { private static Keklist plugin; public KeklistConfigUtil(Keklist plugin) { - this.plugin = plugin; + KeklistConfigUtil.plugin = plugin; } public void updateConfig() {