Fixes the check for testing if a paid sign already exists

This commit is contained in:
Kristian Knarvik 2022-02-18 21:04:23 +01:00
parent 419a79bc9f
commit eaa4f929ca

View File

@ -50,13 +50,12 @@ public class AddCommand implements CommandExecutor {
try {
PaidSign sign = new PaidSign(signName, cost, permission, ignoreCase, ignoreColor);
/* TODO: Rewrite the method for comparing if paid signs are duplicated
for (PaidSign similarSign : manager.getPaidSigns(sign.getCleanId(), sign.getLineIndex())) {
if (sign.matches(similarSign)) {
sender.sendMessage("A paid sign with the same id and line already exists");
for (PaidSign otherSign : manager.getAllPaidSigns()) {
if (sign.getName().equals(otherSign.getName())) {
sender.sendMessage("A paid sign with the same name already exists");
return false;
}
}*/
}
manager.addPaidSign(sign);
sender.sendMessage("Successfully added new paid sign");
return true;