diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java index 63943b83..8e77eea3 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java @@ -34,7 +34,7 @@ public class CosmeticCommand implements CommandExecutor { // 0 1 2 @Override - public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { + public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args) { boolean silent = false; if (args.length == 0) { @@ -69,7 +69,10 @@ public class CosmeticCommand implements CommandExecutor { if (sender.hasPermission("HMCCosmetics.cmd.silent") || sender.isOp()) { for (String singleArg : args) { - if (singleArg.equalsIgnoreCase("-s")) silent = true; + if (singleArg.equalsIgnoreCase("-s")) { + silent = true; + break; + } } } @@ -145,7 +148,7 @@ public class CosmeticCommand implements CommandExecutor { return true; } - CosmeticSlot cosmeticSlot = null; + CosmeticSlot cosmeticSlot; if (sender instanceof Player) player = ((Player) sender).getPlayer(); if (sender.hasPermission("hmccosmetics.cmd.unapply.other")) { diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/listener/PlayerConnectionListener.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/listener/PlayerConnectionListener.java index cd40fd1c..66fde09a 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/listener/PlayerConnectionListener.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/listener/PlayerConnectionListener.java @@ -13,11 +13,12 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.jetbrains.annotations.NotNull; public class PlayerConnectionListener implements Listener { @EventHandler - public void onPlayerJoin(PlayerJoinEvent event) { + public void onPlayerJoin(@NotNull PlayerJoinEvent event) { if (event.getPlayer().isOp() || event.getPlayer().hasPermission("hmccosmetics.notifyupdate")) { if (!HMCCosmeticsPlugin.getLatestVersion().equalsIgnoreCase(HMCCosmeticsPlugin.getInstance().getDescription().getVersion()) && HMCCosmeticsPlugin.getLatestVersion() != null) MessagesUtil.sendMessageNoKey( @@ -46,7 +47,7 @@ public class PlayerConnectionListener implements Listener { } @EventHandler - public void onPlayerQuit(PlayerQuitEvent event) { + public void onPlayerQuit(@NotNull PlayerQuitEvent event) { CosmeticUser user = CosmeticUsers.getUser(event.getPlayer()); if (user == null) { // Remove any passengers if a user failed to initialize. Bugs can cause this to happen if (!event.getPlayer().getPassengers().isEmpty()) {