mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Remove Notnull annotations
This commit is contained in:
1 parent
75f0a7292d
commit
49b3aba0f5
10 files changed
+15
-25
No files matched your search
@@ -2,7 +2,6 @@ package me.william278.huskhomes2.commands;
|
||||
|
||||
import org.bukkit.command.*;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -10,7 +9,7 @@ import java.util.Objects;
|
||||
|
||||
public abstract class CommandBase implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (sender instanceof Player) {
|
||||
onCommand((Player) sender, command, label, args);
|
||||
return true;
|
||||
@@ -35,7 +34,7 @@ public abstract class CommandBase implements CommandExecutor {
|
||||
|
||||
public static class EmptyTab implements TabCompleter {
|
||||
@Override
|
||||
public List<String> onTabComplete(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, String[] strings) {
|
||||
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -312,7 +311,7 @@ public class EditHomeCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
Player p = (Player) sender;
|
||||
if (!p.hasPermission("huskhomes.edithome")) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -18,7 +18,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -198,7 +197,7 @@ public class EditWarpCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
Player p = (Player) sender;
|
||||
if (!p.hasPermission("huskhomes.editwarp")) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -80,7 +79,7 @@ public class HomeCommand extends CommandBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
Player p = (Player) sender;
|
||||
if (!sender.hasPermission("huskhomes.home")) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -63,7 +62,7 @@ public class HuskHomesCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (args.length == 0) {
|
||||
if (sender instanceof Player) {
|
||||
showHelpMenu((Player) sender, 1);
|
||||
@@ -175,7 +174,7 @@ public class HuskHomesCommand extends CommandBase implements TabCompleter {
|
||||
final static String[] COMMAND_TAB_ARGS = {"help", "about", "update", "reload"};
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, Command command, @NotNull String alias, String[] args) {
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
Player p = (Player) sender;
|
||||
if (command.getPermission() != null) {
|
||||
if (!p.hasPermission(command.getPermission())) {
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -70,7 +69,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player p)) {
|
||||
handleConsolePublicHomeTeleport(sender, args);
|
||||
return true;
|
||||
@@ -135,7 +134,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
if (!sender.hasPermission("huskhomes.publichome")) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -11,14 +11,10 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class TpCommand extends CommandBase {
|
||||
|
||||
@@ -117,7 +113,7 @@ public class TpCommand extends CommandBase {
|
||||
|
||||
public static class Tab implements TabCompleter {
|
||||
@Override
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
List<String> players = new ArrayList<>();
|
||||
if (args.length == 0 || args.length == 1) {
|
||||
players.addAll(HuskHomes.getPlayerList().getPlayers());
|
||||
|
||||
@@ -11,7 +11,8 @@ public class TpDenyCommand extends CommandBase {
|
||||
protected void onCommand(Player p, Command command, String label, String[] args) {
|
||||
if (args.length == 1) {
|
||||
String targetPlayer = args[0];
|
||||
TeleportRequestHandler.replyTpRequest(p, NameAutoCompleter.getAutoCompletedName(targetPlayer), false);
|
||||
TeleportRequestHandler.replyTpRequest(p,
|
||||
NameAutoCompleter.getAutoCompletedName(targetPlayer), false);
|
||||
} else {
|
||||
TeleportRequestHandler.replyTpRequest(p, false);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public class TpHereCommand extends CommandBase {
|
||||
if (args.length == 1) {
|
||||
String targetPlayer = args[0];
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
try (Connection connection = HuskHomes.getConnection()) {
|
||||
try {
|
||||
TeleportManager.teleportHere(p, NameAutoCompleter.getAutoCompletedName(targetPlayer));
|
||||
} catch (SQLException e) {
|
||||
plugin.getLogger().log(Level.SEVERE, "An SQL exception occurred using /tphere");
|
||||
|
||||
@@ -11,7 +11,6 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@@ -27,7 +26,7 @@ public class WarpCommand extends CommandBase {
|
||||
private static final HuskHomes plugin = HuskHomes.getInstance();
|
||||
|
||||
@Override
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player p)) {
|
||||
handleConsoleWarp(sender, args);
|
||||
return true;
|
||||
@@ -117,7 +116,7 @@ public class WarpCommand extends CommandBase {
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
if (!sender.hasPermission("huskhomes.warp")) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user