Program: 171279
Project: 171279
Buggy source:
/** 
 * Calculates if the character is able to remove or displace all blocking clothing in order to equip the supplied clothing.
 */
public boolean isAbleToEquip(AbstractClothing newClothing,boolean equipIfAble,boolean automaticClothingManagement,GameCharacter characterClothingOwner,GameCharacter characterClothingEquipper){
  clothingToRemove.clear();
  equipTextSB.setLength(0);
  if (newClothing.getClothingType().getSlot().slotBlockedByRace(characterClothingOwner) != null) {
    equipTextSB.append("String_Node_Str" + Colour.GENERIC_BAD.toWebHexString() + "String_Node_Str"+ newClothing.getClothingType().getSlot().getCannotBeWornDescription(characterClothingOwner)+ "String_Node_Str");
    return false;
  }
  if (!newClothing.getClothingType().isCanBeEquipped(characterClothingOwner)) {
    equipTextSB.append("String_Node_Str" + Colour.GENERIC_BAD.toWebHexString() + "String_Node_Str"+ newClothing.getClothingType().getCannotBeEquippedText(characterClothingOwner)+ "String_Node_Str");
    return false;
  }
  if (getClothingInSlot(newClothing.getClothingType().getSlot()) != null) {
    if (getClothingInSlot(newClothing.getClothingType().getSlot()).isSealed()) {
      equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ Colour.SEALED.toWebHexString()+ "String_Node_Str"+ getClothingInSlot(newClothing.getClothingType().getSlot()).getName()+ "String_Node_Str");
      return false;
    }
  }
  if (!characterClothingOwner.isPiercedEar() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_EAR) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedNose() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_NOSE) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedLip() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_LIP) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedTongue() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_TONGUE) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedNavel() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_STOMACH) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedNipple() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_NIPPLE) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedVagina() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_VAGINA) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedPenis() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_PENIS) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  incompatibleUnequippableClothing.clear();
  incompatibleRemovableClothing.clear();
  for (  InventorySlot slot : newClothing.getClothingType().getIncompatibleSlots()) {
    if (getClothingInSlot(slot) != null) {
      if (!isAbleToUnequip(getClothingInSlot(slot),false,automaticClothingManagement,characterClothingOwner,characterClothingEquipper,true))       incompatibleUnequippableClothing.add(getClothingInSlot(slot));
 else {
        clothingToRemove.put(getClothingInSlot(slot),DisplacementType.REMOVE_OR_EQUIP);
        incompatibleRemovableClothing.add(getClothingInSlot(slot));
      }
    }
  }
  for (  AbstractClothing clothing : clothingCurrentlyEquipped) {
    if (clothing.getClothingType().getIncompatibleSlots().contains(newClothing.getClothingType().getSlot())) {
      if (!isAbleToUnequip(clothing,false,automaticClothingManagement,characterClothingOwner,characterClothingEquipper,true)) {
        incompatibleUnequippableClothing.add(clothing);
      }
 else {
        clothingToRemove.put(clothing,DisplacementType.REMOVE_OR_EQUIP);
        incompatibleRemovableClothing.add(clothing);
      }
    }
  }
  if (!incompatibleUnequippableClothing.isEmpty()) {
    for (    AbstractClothing c : incompatibleUnequippableClothing) {
      if (c.isSealed())       equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ Colour.SEALED.toWebHexString()+ "String_Node_Str"+ c.getName()+ "String_Node_Str"+ (c.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
    }
    return false;
  }
  for (  BlockedParts bp : newClothing.getClothingType().getBlockedPartsList()) {
    if (bp.displacementType == DisplacementType.REMOVE_OR_EQUIP) {
      if (bp.clothingAccessRequired == null) {
        break;
      }
 else {
        for (        AbstractClothing equippedClothing : clothingCurrentlyEquipped) {
          for (          BlockedParts bpEquipped : equippedClothing.getClothingType().getBlockedPartsList()) {
            for (            ClothingAccess caBlocked : bpEquipped.clothingAccessBlocked) {
              if (bp.clothingAccessRequired.contains(caBlocked) && !equippedClothing.getDisplacedList().contains(bpEquipped.displacementType) && !isDisplacementAvailableFromElsewhere(equippedClothing,caBlocked)) {
                if (!clothingToRemove.containsKey(equippedClothing)) {
                  if (automaticClothingManagement && isAbleToBeDisplaced(equippedClothing,bpEquipped.displacementType,false,automaticClothingManagement,characterClothingOwner,characterClothingEquipper,true)) {
                    clothingToRemove.put(equippedClothing,bpEquipped.displacementType);
                  }
 else {
                    equipTextSB.append("String_Node_Str" + Colour.GENERIC_BAD.toWebHexString() + "String_Node_Str"+ equippedClothing.getName()+ "String_Node_Str"+ (equippedClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ newClothing.getName()+ "String_Node_Str");
                    blockingClothing=equippedClothing;
                    return false;
                  }
                }
 else {
                  if (isAbleToUnequip(equippedClothing,false,automaticClothingManagement,characterClothingOwner,characterClothingEquipper,true)) {
                    clothingToRemove.put(equippedClothing,DisplacementType.REMOVE_OR_EQUIP);
                  }
 else {
                    if (equippedClothing.isSealed()) {
                      equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ Colour.SEALED.toWebHexString()+ "String_Node_Str"+ equippedClothing.getName()+ "String_Node_Str"+ (equippedClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
                    }
 else {
                      equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ equippedClothing.getName()+ "String_Node_Str"+ (equippedClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
                    }
                    blockingClothing=equippedClothing;
                    return false;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (equipIfAble) {
    equipTextSB=new StringBuilder();
    if (automaticClothingManagement || (clothingToRemove.size() == incompatibleRemovableClothing.size() + 1)) {
      if (getClothingInSlot(newClothing.getClothingType().getSlot()) != null) {
        AbstractClothing equippedClothing=getClothingInSlot(newClothing.getClothingType().getSlot());
        if (isAbleToUnequip(equippedClothing,false,automaticClothingManagement,characterClothingOwner,characterClothingEquipper,true)) {
          clothingToRemove.put(equippedClothing,DisplacementType.REMOVE_OR_EQUIP);
        }
 else {
          if (equippedClothing.isSealed()) {
            equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ Colour.SEALED.toWebHexString()+ "String_Node_Str"+ equippedClothing.getName()+ "String_Node_Str"+ (equippedClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
          }
 else {
            equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ equippedClothing.getName()+ "String_Node_Str"+ (equippedClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
          }
          blockingClothing=equippedClothing;
          return false;
        }
      }
      List<AbstractClothing> tempClothingList=new ArrayList<>();
      for (      AbstractClothing cl : clothingToRemove.keySet())       if (!tempClothingList.contains(cl))       tempClothingList.add(cl);
      for (      AbstractClothing cl : incompatibleRemovableClothing)       if (!tempClothingList.contains(cl))       tempClothingList.add(cl);
      tempClothingList.sort(new ClothingZLayerComparator());
      List<AbstractClothing> clothingToBeReplaced=new ArrayList<>();
      for (      AbstractClothing c : tempClothingList) {
        if (!incompatibleRemovableClothing.contains(c) && c != getClothingInSlot(newClothing.getClothingType().getSlot())) {
          clothingToBeReplaced.add(c);
        }
        equipTextSB.append((equipTextSB.length() == 0 ? "String_Node_Str" : "String_Node_Str") + (clothingToRemove.get(c) == DisplacementType.REMOVE_OR_EQUIP ? c.onUnequipText(characterClothingOwner,characterClothingEquipper,false) : "String_Node_Str" + clothingToRemove.get(c).getDescription() + "String_Node_Str"+ c.getName()+ "String_Node_Str"));
      }
      for (      AbstractClothing c : incompatibleRemovableClothing) {
        if (!characterClothingOwner.isInventoryFull() || characterClothingOwner.hasClothing(c))         equipTextSB.append("String_Node_Str" + characterClothingOwner.addedItemToInventoryText(c));
 else         equipTextSB.append("String_Node_Str" + characterClothingOwner.droppedItemText(c));
        String oldEquipText=equipTextSB.toString();
        if (Main.game.isInNewWorld()) {
          characterClothingOwner.unequipClothingIntoInventory(c,true,characterClothingEquipper);
        }
 else {
          characterClothingOwner.unequipClothingOntoFloor(c,true,characterClothingEquipper);
        }
        equipTextSB.setLength(0);
        equipTextSB.append(oldEquipText);
      }
      newClothing.getDisplacedList().clear();
      if (getClothingInSlot(newClothing.getClothingType().getSlot()) != null) {
        if (getClothingInSlot(newClothing.getClothingType().getSlot()).getClothingType().isDiscardedOnUnequip()) {
          String oldEquipText=equipTextSB.toString();
          characterClothingOwner.unequipClothingIntoVoid(getClothingInSlot(newClothing.getClothingType().getSlot()),true,characterClothingEquipper);
          equipTextSB.setLength(0);
          equipTextSB.append(oldEquipText);
        }
 else {
          if ((!characterClothingOwner.isInventoryFull() || characterClothingOwner.hasClothing(getClothingInSlot(newClothing.getClothingType().getSlot()))) && Main.game.isInNewWorld()) {
            equipTextSB.append("String_Node_Str" + characterClothingOwner.addedItemToInventoryText(getClothingInSlot(newClothing.getClothingType().getSlot())));
          }
 else {
            equipTextSB.append("String_Node_Str" + characterClothingOwner.droppedItemText(getClothingInSlot(newClothing.getClothingType().getSlot())));
          }
          String oldEquipText=equipTextSB.toString();
          if (Main.game.isInNewWorld()) {
            characterClothingOwner.unequipClothingIntoInventory(getClothingInSlot(newClothing.getClothingType().getSlot()),true,characterClothingEquipper);
          }
 else {
            characterClothingOwner.unequipClothingOntoFloor(getClothingInSlot(newClothing.getClothingType().getSlot()),true,characterClothingEquipper);
          }
          equipTextSB.setLength(0);
          equipTextSB.append(oldEquipText);
        }
      }
      clothingCurrentlyEquipped.add(newClothing);
      equipTextSB.append((equipTextSB.length() == 0 ? "String_Node_Str" : "String_Node_Str") + newClothing.onEquipApplyEffects(characterClothingOwner,characterClothingEquipper,false));
      clothingToBeReplaced.sort(new ReverseClothingZLayerComparator());
      if (!clothingToBeReplaced.isEmpty()) {
        equipTextSB.append("String_Node_Str" + (characterClothingOwner.isPlayer() ? "String_Node_Str" : characterClothingOwner.getName("String_Node_Str") + "String_Node_Str") + "String_Node_Str"+ Util.clothesToStringList(clothingToBeReplaced)+ "String_Node_Str");
      }
      if (newClothing.getClothingType().getClothingSet() != null) {
        if (clothingSetCount.get(newClothing.getClothingType().getClothingSet()) == null) {
          clothingSetCount.put(newClothing.getClothingType().getClothingSet(),1);
        }
 else {
          clothingSetCount.put(newClothing.getClothingType().getClothingSet(),clothingSetCount.get(newClothing.getClothingType().getClothingSet()) + 1);
        }
      }
    }
    clothingCurrentlyEquipped.sort(new AbstractClothingRarityComparator());
  }
 else {
    if (clothingToRemove.isEmpty()) {
      equipTextSB.append(Util.capitaliseSentence(newClothing.getName(true)) + "String_Node_Str" + (newClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
    }
 else {
      equipTextSB.append(Util.capitaliseSentence("String_Node_Str" + newClothing.getClothingType().getDeterminer()) + "String_Node_Str" + newClothing.getName()+ "String_Node_Str"+ Util.clothesToStringList(clothingToRemove.keySet())+ "String_Node_Str"+ (clothingToRemove.size() > 1 ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Calculates if the character is able to remove or displace all blocking clothing in order to equip the supplied clothing.
 */
public boolean isAbleToEquip(AbstractClothing newClothing,boolean equipIfAble,boolean automaticClothingManagement,GameCharacter characterClothingOwner,GameCharacter characterClothingEquipper){
  clothingToRemove.clear();
  equipTextSB.setLength(0);
  if (newClothing.getClothingType().getSlot().slotBlockedByRace(characterClothingOwner) != null) {
    equipTextSB.append("String_Node_Str" + Colour.GENERIC_BAD.toWebHexString() + "String_Node_Str"+ newClothing.getClothingType().getSlot().getCannotBeWornDescription(characterClothingOwner)+ "String_Node_Str");
    return false;
  }
  if (!newClothing.getClothingType().isCanBeEquipped(characterClothingOwner)) {
    equipTextSB.append("String_Node_Str" + Colour.GENERIC_BAD.toWebHexString() + "String_Node_Str"+ newClothing.getClothingType().getCannotBeEquippedText(characterClothingOwner)+ "String_Node_Str");
    return false;
  }
  if (getClothingInSlot(newClothing.getClothingType().getSlot()) != null) {
    if (getClothingInSlot(newClothing.getClothingType().getSlot()).isSealed()) {
      if (characterClothingOwner.isPlayer()) {
        equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ Colour.SEALED.toWebHexString()+ "String_Node_Str"+ getClothingInSlot(newClothing.getClothingType().getSlot()).getName()+ "String_Node_Str");
      }
 else {
        equipTextSB.append(UtilText.parse(characterClothingOwner,"String_Node_Str" + newClothing.getName() + "String_Node_Str"+ Colour.SEALED.toWebHexString()+ "String_Node_Str"+ getClothingInSlot(newClothing.getClothingType().getSlot()).getName()+ "String_Node_Str"));
      }
      return false;
    }
  }
  if (!characterClothingOwner.isPiercedEar() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_EAR) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedNose() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_NOSE) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedLip() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_LIP) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedTongue() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_TONGUE) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedNavel() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_STOMACH) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedNipple() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_NIPPLE) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedVagina() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_VAGINA) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  if (!characterClothingOwner.isPiercedPenis() && newClothing.getClothingType().getSlot() == InventorySlot.PIERCING_PENIS) {
    equipTextSB.append("String_Node_Str");
    return false;
  }
  incompatibleUnequippableClothing.clear();
  incompatibleRemovableClothing.clear();
  for (  InventorySlot slot : newClothing.getClothingType().getIncompatibleSlots()) {
    if (getClothingInSlot(slot) != null) {
      if (!isAbleToUnequip(getClothingInSlot(slot),false,automaticClothingManagement,characterClothingOwner,characterClothingEquipper,true))       incompatibleUnequippableClothing.add(getClothingInSlot(slot));
 else {
        clothingToRemove.put(getClothingInSlot(slot),DisplacementType.REMOVE_OR_EQUIP);
        incompatibleRemovableClothing.add(getClothingInSlot(slot));
      }
    }
  }
  for (  AbstractClothing clothing : clothingCurrentlyEquipped) {
    if (clothing.getClothingType().getIncompatibleSlots().contains(newClothing.getClothingType().getSlot())) {
      if (!isAbleToUnequip(clothing,false,automaticClothingManagement,characterClothingOwner,characterClothingEquipper,true)) {
        incompatibleUnequippableClothing.add(clothing);
      }
 else {
        clothingToRemove.put(clothing,DisplacementType.REMOVE_OR_EQUIP);
        incompatibleRemovableClothing.add(clothing);
      }
    }
  }
  if (!incompatibleUnequippableClothing.isEmpty()) {
    for (    AbstractClothing c : incompatibleUnequippableClothing) {
      if (c.isSealed())       equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ Colour.SEALED.toWebHexString()+ "String_Node_Str"+ c.getName()+ "String_Node_Str"+ (c.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
    }
    return false;
  }
  for (  BlockedParts bp : newClothing.getClothingType().getBlockedPartsList()) {
    if (bp.displacementType == DisplacementType.REMOVE_OR_EQUIP) {
      if (bp.clothingAccessRequired == null) {
        break;
      }
 else {
        for (        AbstractClothing equippedClothing : clothingCurrentlyEquipped) {
          for (          BlockedParts bpEquipped : equippedClothing.getClothingType().getBlockedPartsList()) {
            for (            ClothingAccess caBlocked : bpEquipped.clothingAccessBlocked) {
              if (bp.clothingAccessRequired.contains(caBlocked) && !equippedClothing.getDisplacedList().contains(bpEquipped.displacementType) && !isDisplacementAvailableFromElsewhere(equippedClothing,caBlocked)) {
                if (!clothingToRemove.containsKey(equippedClothing)) {
                  if (automaticClothingManagement && isAbleToBeDisplaced(equippedClothing,bpEquipped.displacementType,false,automaticClothingManagement,characterClothingOwner,characterClothingEquipper,true)) {
                    clothingToRemove.put(equippedClothing,bpEquipped.displacementType);
                  }
 else {
                    equipTextSB.append("String_Node_Str" + Colour.GENERIC_BAD.toWebHexString() + "String_Node_Str"+ equippedClothing.getName()+ "String_Node_Str"+ (equippedClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ newClothing.getName()+ "String_Node_Str");
                    blockingClothing=equippedClothing;
                    return false;
                  }
                }
 else {
                  if (isAbleToUnequip(equippedClothing,false,automaticClothingManagement,characterClothingOwner,characterClothingEquipper,true)) {
                    clothingToRemove.put(equippedClothing,DisplacementType.REMOVE_OR_EQUIP);
                  }
 else {
                    if (equippedClothing.isSealed()) {
                      equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ Colour.SEALED.toWebHexString()+ "String_Node_Str"+ equippedClothing.getName()+ "String_Node_Str"+ (equippedClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
                    }
 else {
                      equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ equippedClothing.getName()+ "String_Node_Str"+ (equippedClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
                    }
                    blockingClothing=equippedClothing;
                    return false;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (equipIfAble) {
    equipTextSB=new StringBuilder();
    if (automaticClothingManagement || (clothingToRemove.size() == incompatibleRemovableClothing.size() + 1)) {
      if (getClothingInSlot(newClothing.getClothingType().getSlot()) != null) {
        AbstractClothing equippedClothing=getClothingInSlot(newClothing.getClothingType().getSlot());
        if (isAbleToUnequip(equippedClothing,false,automaticClothingManagement,characterClothingOwner,characterClothingEquipper,true)) {
          clothingToRemove.put(equippedClothing,DisplacementType.REMOVE_OR_EQUIP);
        }
 else {
          if (equippedClothing.isSealed()) {
            equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ Colour.SEALED.toWebHexString()+ "String_Node_Str"+ equippedClothing.getName()+ "String_Node_Str"+ (equippedClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
          }
 else {
            equipTextSB.append("String_Node_Str" + newClothing.getName() + "String_Node_Str"+ equippedClothing.getName()+ "String_Node_Str"+ (equippedClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
          }
          blockingClothing=equippedClothing;
          return false;
        }
      }
      List<AbstractClothing> tempClothingList=new ArrayList<>();
      for (      AbstractClothing cl : clothingToRemove.keySet())       if (!tempClothingList.contains(cl))       tempClothingList.add(cl);
      for (      AbstractClothing cl : incompatibleRemovableClothing)       if (!tempClothingList.contains(cl))       tempClothingList.add(cl);
      tempClothingList.sort(new ClothingZLayerComparator());
      List<AbstractClothing> clothingToBeReplaced=new ArrayList<>();
      for (      AbstractClothing c : tempClothingList) {
        if (!incompatibleRemovableClothing.contains(c) && c != getClothingInSlot(newClothing.getClothingType().getSlot())) {
          clothingToBeReplaced.add(c);
        }
        equipTextSB.append((equipTextSB.length() == 0 ? "String_Node_Str" : "String_Node_Str") + (clothingToRemove.get(c) == DisplacementType.REMOVE_OR_EQUIP ? c.onUnequipText(characterClothingOwner,characterClothingEquipper,false) : "String_Node_Str" + clothingToRemove.get(c).getDescription() + "String_Node_Str"+ c.getName()+ "String_Node_Str"));
      }
      for (      AbstractClothing c : incompatibleRemovableClothing) {
        if (!characterClothingOwner.isInventoryFull() || characterClothingOwner.hasClothing(c))         equipTextSB.append("String_Node_Str" + characterClothingOwner.addedItemToInventoryText(c));
 else         equipTextSB.append("String_Node_Str" + characterClothingOwner.droppedItemText(c));
        String oldEquipText=equipTextSB.toString();
        if (Main.game.isInNewWorld()) {
          characterClothingOwner.unequipClothingIntoInventory(c,true,characterClothingEquipper);
        }
 else {
          characterClothingOwner.unequipClothingOntoFloor(c,true,characterClothingEquipper);
        }
        equipTextSB.setLength(0);
        equipTextSB.append(oldEquipText);
      }
      newClothing.getDisplacedList().clear();
      if (getClothingInSlot(newClothing.getClothingType().getSlot()) != null) {
        if (getClothingInSlot(newClothing.getClothingType().getSlot()).getClothingType().isDiscardedOnUnequip()) {
          String oldEquipText=equipTextSB.toString();
          characterClothingOwner.unequipClothingIntoVoid(getClothingInSlot(newClothing.getClothingType().getSlot()),true,characterClothingEquipper);
          equipTextSB.setLength(0);
          equipTextSB.append(oldEquipText);
        }
 else {
          if ((!characterClothingOwner.isInventoryFull() || characterClothingOwner.hasClothing(getClothingInSlot(newClothing.getClothingType().getSlot()))) && Main.game.isInNewWorld()) {
            equipTextSB.append("String_Node_Str" + characterClothingOwner.addedItemToInventoryText(getClothingInSlot(newClothing.getClothingType().getSlot())));
          }
 else {
            equipTextSB.append("String_Node_Str" + characterClothingOwner.droppedItemText(getClothingInSlot(newClothing.getClothingType().getSlot())));
          }
          String oldEquipText=equipTextSB.toString();
          if (Main.game.isInNewWorld()) {
            characterClothingOwner.unequipClothingIntoInventory(getClothingInSlot(newClothing.getClothingType().getSlot()),true,characterClothingEquipper);
          }
 else {
            characterClothingOwner.unequipClothingOntoFloor(getClothingInSlot(newClothing.getClothingType().getSlot()),true,characterClothingEquipper);
          }
          equipTextSB.setLength(0);
          equipTextSB.append(oldEquipText);
        }
      }
      clothingCurrentlyEquipped.add(newClothing);
      equipTextSB.append((equipTextSB.length() == 0 ? "String_Node_Str" : "String_Node_Str") + newClothing.onEquipApplyEffects(characterClothingOwner,characterClothingEquipper,false));
      clothingToBeReplaced.sort(new ReverseClothingZLayerComparator());
      if (!clothingToBeReplaced.isEmpty()) {
        equipTextSB.append("String_Node_Str" + (characterClothingOwner.isPlayer() ? "String_Node_Str" : characterClothingOwner.getName("String_Node_Str") + "String_Node_Str") + "String_Node_Str"+ Util.clothesToStringList(clothingToBeReplaced)+ "String_Node_Str");
      }
      if (newClothing.getClothingType().getClothingSet() != null) {
        if (clothingSetCount.get(newClothing.getClothingType().getClothingSet()) == null) {
          clothingSetCount.put(newClothing.getClothingType().getClothingSet(),1);
        }
 else {
          clothingSetCount.put(newClothing.getClothingType().getClothingSet(),clothingSetCount.get(newClothing.getClothingType().getClothingSet()) + 1);
        }
      }
    }
    clothingCurrentlyEquipped.sort(new AbstractClothingRarityComparator());
  }
 else {
    if (clothingToRemove.isEmpty()) {
      equipTextSB.append(Util.capitaliseSentence(newClothing.getName(true)) + "String_Node_Str" + (newClothing.getClothingType().isPlural() ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
    }
 else {
      equipTextSB.append(Util.capitaliseSentence("String_Node_Str" + newClothing.getClothingType().getDeterminer()) + "String_Node_Str" + newClothing.getName()+ "String_Node_Str"+ Util.clothesToStringList(clothingToRemove.keySet())+ "String_Node_Str"+ (clothingToRemove.size() > 1 ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
    }
  }
  return true;
}