fix: consistency, maven warning

This commit is contained in:
amyavi 2024-06-25 22:31:31 -03:00
parent 876ec6ae44
commit 91787dec90
No known key found for this signature in database
3 changed files with 13 additions and 13 deletions

View file

@ -5,8 +5,7 @@
<version>master</version>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.release>17</maven.compiler.release>
<maven.test.skip>true</maven.test.skip>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

View file

@ -33,7 +33,8 @@ public final class CommandSpyState {
} catch (final FileNotFoundException exception) {
try {
this.save(); // Create file if it doesn't exist
} catch (IOException ignored) {}
} catch (IOException ignored) {
}
} catch (final IOException exception) {
LOGGER.error("Failed to load state file:", exception);
}

View file

@ -1,8 +1,7 @@
package pw.kaboom.commandspy;
import java.io.File;
import java.util.UUID;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -14,10 +13,11 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.SignChangeEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.plugin.java.JavaPlugin;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.UUID;
public final class Main extends JavaPlugin implements CommandExecutor, Listener {
private CommandSpyState config;
@ -47,7 +47,7 @@ public final class Main extends JavaPlugin implements CommandExecutor, Listener
target.sendMessage(Component.empty()
.append(Component.text("Successfully "))
.append(stateString)
.append(Component.text(" CommandSpy.")));
.append(Component.text(" CommandSpy")));
if (source != target) {
source.sendMessage(Component.empty()
@ -55,7 +55,6 @@ public final class Main extends JavaPlugin implements CommandExecutor, Listener
.append(stateString)
.append(Component.text(" CommandSpy for "))
.append(target.name())
.append(Component.text("."))
);
}
}
@ -76,7 +75,8 @@ public final class Main extends JavaPlugin implements CommandExecutor, Listener
Boolean state = null;
switch (args.length) {
case 0 -> {}
case 0 -> {
}
case 1, 2 -> {
// Get the last argument as a state. Fail if we have 2 arguments.
state = getState(args[args.length - 1]);