Skip to content

Commit 7dd87ab

Browse files
committed
Add @NotNull annotations to clarify that these parameters and return values must never be null, improving code safety and clarity.
1 parent 094bf29 commit 7dd87ab

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

src/main/java/no/vestlandetmc/BanFromClaim/commands/BfcAllCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
import org.bukkit.command.CommandExecutor;
1010
import org.bukkit.command.CommandSender;
1111
import org.bukkit.entity.Player;
12+
import org.jetbrains.annotations.NotNull;
1213

1314
public class BfcAllCommand implements CommandExecutor {
1415

1516
@Override
16-
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
17+
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
1718
if (!(sender instanceof Player player)) {
1819
MessageHandler.sendConsole("&cThis command can only be used in-game.");
1920
return true;

src/main/java/no/vestlandetmc/BanFromClaim/commands/BfcCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
import org.bukkit.command.CommandExecutor;
1515
import org.bukkit.command.CommandSender;
1616
import org.bukkit.entity.Player;
17+
import org.jetbrains.annotations.NotNull;
1718

1819
public class BfcCommand implements CommandExecutor {
1920

2021
@SuppressWarnings("deprecation")
2122
@Override
22-
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
23+
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
2324
if (!(sender instanceof Player player)) {
2425
MessageHandler.sendConsole("&cThis command can only be used in-game.");
2526
return true;

src/main/java/no/vestlandetmc/BanFromClaim/commands/BfclistCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.bukkit.command.CommandExecutor;
1212
import org.bukkit.command.CommandSender;
1313
import org.bukkit.entity.Player;
14+
import org.jetbrains.annotations.NotNull;
1415

1516
import java.util.List;
1617
import java.util.UUID;
@@ -22,7 +23,7 @@ public class BfclistCommand implements CommandExecutor {
2223
int number = 1;
2324

2425
@Override
25-
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
26+
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
2627
if (!(sender instanceof Player player)) {
2728
MessageHandler.sendConsole("&cThis command can only be used in-game.");
2829
return true;

src/main/java/no/vestlandetmc/BanFromClaim/commands/KfcCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
import org.bukkit.command.CommandExecutor;
1313
import org.bukkit.command.CommandSender;
1414
import org.bukkit.entity.Player;
15+
import org.jetbrains.annotations.NotNull;
1516

1617
public class KfcCommand implements CommandExecutor {
1718

1819
@Override
19-
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
20+
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
2021
if (!(sender instanceof Player player)) {
2122
MessageHandler.sendConsole("&cThis command can only be used in-game.");
2223
return true;

src/main/java/no/vestlandetmc/BanFromClaim/commands/SafeSpot.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
import org.bukkit.command.CommandExecutor;
77
import org.bukkit.command.CommandSender;
88
import org.bukkit.entity.Player;
9+
import org.jetbrains.annotations.NotNull;
910

1011
public class SafeSpot implements CommandExecutor {
1112

1213
@Override
13-
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
14+
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
1415
if (!(sender instanceof Player player)) {
1516
MessageHandler.sendConsole("&cYou cannot use this command from the console.");
1617
return true;

src/main/java/no/vestlandetmc/BanFromClaim/commands/UnbfcCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
import org.bukkit.command.CommandExecutor;
1212
import org.bukkit.command.CommandSender;
1313
import org.bukkit.entity.Player;
14+
import org.jetbrains.annotations.NotNull;
1415

1516
import java.util.List;
1617
import java.util.UUID;
1718

1819
public class UnbfcCommand implements CommandExecutor {
1920

2021
@Override
21-
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
22+
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
2223
if (!(sender instanceof Player player)) {
2324
MessageHandler.sendConsole("&cThis command can only be used in-game.");
2425
return true;

0 commit comments

Comments
 (0)