mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 06:28:49 +00:00
Cleanup Pl3xMap support, general optimisations and warning scrubbing
This commit is contained in:
1 parent
c89d263505
commit
a3a62db800
17 files changed
+79
-39
No files matched your search
@@ -12,6 +12,7 @@ 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;
|
||||
@@ -47,7 +48,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) {
|
||||
if (!(sender instanceof Player p)) {
|
||||
handleConsolePublicHomeTeleport(sender, args);
|
||||
return true;
|
||||
@@ -66,6 +67,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompleter {
|
||||
String homeName = split[1];
|
||||
if (DataManager.homeExists(ownerName, homeName, connection)) {
|
||||
Home home = DataManager.getHome(ownerName, homeName, connection);
|
||||
assert home != null;
|
||||
if (home.isPublic()) {
|
||||
TeleportManager.queueTimedTeleport(p, home, connection);
|
||||
} else {
|
||||
@@ -101,6 +103,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompleter {
|
||||
try {
|
||||
if (DataManager.homeExists(ownerName, homeName, connection)) {
|
||||
Home home = DataManager.getHome(ownerName, homeName, connection);
|
||||
assert home != null;
|
||||
if (!home.isPublic()) {
|
||||
sender.sendMessage("Warning: Bypassed home security (" + home.getName() + " was not set to public by " + home.getOwnerUsername() + ")");
|
||||
}
|
||||
@@ -131,7 +134,7 @@ public class PublicHomeCommand extends CommandBase implements TabCompleter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
||||
public List<String> onTabComplete(CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
if (!sender.hasPermission("huskhomes.publichome")) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user