Fix duplicate handling, delete invalid signs with /ss delete

This commit is contained in:
NotAlexNoyle committed 2026-04-23 13:50:42 -04:00
1 parent acfcbe4ea1
commit dfa2e7d95f
3 files changed
+28 -11

No files matched your search

@@ -49,9 +49,13 @@ public class Delete {
UtilitiesOG.trueogMessage(p, "&6Sign &e" + name + " &6successfully deleted.");
} else if (SudoSigns.config.getInvalidEntriesManager().purgeInvalidEntry(name, false)) {
UtilitiesOG.trueogMessage(p, "&6Sign &e" + name + " &6successfully deleted.");
} else {
UtilitiesOG.trueogMessage(p, "&cERROR: A sign with the name &e" + " &cdoes not exist!");
UtilitiesOG.trueogMessage(p, "&cERROR: A sign with the name &e" + name + " &cdoes not exist!");
}
@@ -131,7 +131,19 @@ public class SudoSignsTabCompleter implements TabCompleter {
return suggestions;
}
case "delete", "view", "run", "tp", "copy", "select", "edit" -> {
case "delete" -> {
if (p.hasPermission(Permissions.DELETE)) {
SudoSigns.signs.values().forEach(s -> suggestions.add(s.getName()));
suggestions.addAll(SudoSigns.invalidSigns);
}
return suggestions;
}
case "view", "run", "tp", "copy", "select", "edit" -> {
if (p.hasPermission(Permissions.SELECT) || p.hasPermission(Permissions.VIEW)
|| p.hasPermission(Permissions.RUN) || p.hasPermission(Permissions.TP)
@@ -84,7 +84,7 @@ public class SignConfig {
.warning(SudoSigns.getPlugin().getConfig().getString("config.console-prefix")
+ "ERROR: Failed to load Sign " + key + " at " + world + " " + loc.getBlockX()
+ ", " + loc.getBlockY() + ", " + loc.getBlockZ()
+ "! Another SudoSign already uses that block location. Skipping...");
+ "! Cause: another SudoSign already uses that block location. Skipping...");
continue;
}
@@ -177,20 +177,21 @@ public class SignConfig {
invalidSigns.add(key);
final String actualBlockType = loc.getBlock().getType().toString();
Bukkit.getLogger().warning(SudoSigns.getPlugin().getConfig().getString("config.console-prefix")
+ "ERROR: Failed to load Sign " + key + " at " + world + " " + loc.getBlockX() + ", "
+ loc.getBlockY() + ", " + loc.getBlockZ() + "! The block at the provided location is "
+ actualBlockType + ", not a sign. Skipping...");
Bukkit.getLogger()
.warning(SudoSigns.getPlugin().getConfig().getString("config.console-prefix")
+ "ERROR: Failed to load Sign " + key + " at " + world + " " + loc.getBlockX()
+ ", " + loc.getBlockY() + ", " + loc.getBlockZ()
+ "! Cause: the block at the provided location is " + actualBlockType
+ ", not a sign. Skipping...");
}
} else {
invalidSigns.add(key);
Bukkit.getLogger()
.warning(SudoSigns.getPlugin().getConfig().getString("config.console-prefix")
+ "ERROR: Failed to load Sign " + key + " at " + world + " " + x + ", " + y + ", "
+ z + "! The world '" + world + "' does not exist or is not loaded. Skipping...");
Bukkit.getLogger().warning(SudoSigns.getPlugin().getConfig().getString("config.console-prefix")
+ "ERROR: Failed to load Sign " + key + " at " + world + " " + x + ", " + y + ", " + z
+ "! Cause: the world '" + world + "' does not exist or is not loaded. Skipping...");
}