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 { try {
PaidSign sign = new PaidSign(signName, cost, permission, ignoreCase, ignoreColor); PaidSign sign = new PaidSign(signName, cost, permission, ignoreCase, ignoreColor);
/* TODO: Rewrite the method for comparing if paid signs are duplicated for (PaidSign otherSign : manager.getAllPaidSigns()) {
for (PaidSign similarSign : manager.getPaidSigns(sign.getCleanId(), sign.getLineIndex())) { if (sign.getName().equals(otherSign.getName())) {
if (sign.matches(similarSign)) { sender.sendMessage("A paid sign with the same name already exists");
sender.sendMessage("A paid sign with the same id and line already exists");
return false; return false;
} }
}*/ }
manager.addPaidSign(sign); manager.addPaidSign(sign);
sender.sendMessage("Successfully added new paid sign"); sender.sendMessage("Successfully added new paid sign");
return true; return true;