Here's what happens ingame: The flag message will appear when i have a cape on but when I don't nothing happens

Code:
	case 4388://castle wars red portal
			//red cape is 4042
			//blue cape is 4041


				if(player.getEquipment().get(1).getDefinition().getId() != -1) {
					player.sm("You can't wear hat's or capes in CastleWars!");
				}
				if(player.getEquipment().get(1).getDefinition().getId() == -1) {
				player.tele(2372 ,3131, 1);
				player.sara = 0;
				player.zammy = 1;
				player.getEquipment().set(Equipment.SLOT_CAPE, new Item(4042));
				player.getEquipment().clearslot(Equipment.SLOT_HAT);
				player.getUpdateFlags().setAppearanceUpdateRequired(true);
				player.resetAttack();
				} 

						
			break;

The actual code works without flags, but I need the flags for well, Castlewars!


Also, when I try to set it at null, its uncomparable, and the null as 0 doesnt work